ScummVM API documentation
MM::MM1::Events Class Referenceabstract

#include <events.h>

Inheritance diagram for MM::MM1::Events:
MM::MM1::UIElement MM::MM1::Mouse MM::MM1::MM1Engine

Public Member Functions

 Events (bool enhancedMode)
 
void runGame ()
 
void replaceView (UIElement *ui, bool replaceAllViews=false)
 
void replaceView (const Common::String &name, bool replaceAllViews=false)
 
void addView (UIElement *ui)
 
void addView (const Common::String &name)
 
void clearViews ()
 
void popView ()
 
void redrawViews ()
 
UIElementfocusedView () const
 
UIElementpriorView () const
 
bool isPresent (const Common::String &name) const
 
bool isInCombat () const
 
Graphics::ScreengetScreen () const
 
void drawElements ()
 
void addKeypress (const Common::KeyCode kc)
 
void addAction (KeybindingAction action)
 
bool isKeypressPending () const
 
void draw () override
 
bool tick () override
 
void close () override
 
- Public Member Functions inherited from MM::MM1::UIElement
 UIElement (const Common::String &name, UIElement *uiParent)
 
bool needsRedraw () const
 
void redraw ()
 
void focus ()
 
bool isFocused () const
 
void replaceView (UIElement *ui, bool replaceAllViews=false)
 
void replaceView (const Common::String &name, bool replaceAllViews=false)
 
void addView (UIElement *ui)
 
void addView (const Common::String &name)
 
void addView ()
 
void open ()
 
int getRandomNumber (int minNumber, int maxNumber)
 
int getRandomNumber (int maxNumber)
 
Common::String getName () const
 
virtual void setBounds (const Common::Rect &r)
 
Common::Rect getBounds () const
 
Graphics::ManagedSurface getSurface () const
 
virtual void clearSurface ()
 
virtual UIElementfindView (const Common::String &name)
 
bool send (const Common::String &viewName, const FocusMessage &msg)
 
bool send (const FocusMessage &msg)
 
bool send (const Common::String &viewName, const UnfocusMessage &msg)
 
bool send (const UnfocusMessage &msg)
 
bool send (const Common::String &viewName, const KeypressMessage &msg)
 
bool send (const KeypressMessage &msg)
 
bool send (const Common::String &viewName, const MouseDownMessage &msg)
 
bool send (const MouseDownMessage &msg)
 
bool send (const Common::String &viewName, const MouseUpMessage &msg)
 
bool send (const MouseUpMessage &msg)
 
bool send (const Common::String &viewName, const ActionMessage &msg)
 
bool send (const ActionMessage &msg)
 
bool send (const Common::String &viewName, const GameMessage &msg)
 
bool send (const GameMessage &msg)
 
bool send (const Common::String &viewName, const HeaderMessage &msg)
 
bool send (const HeaderMessage &msg)
 
bool send (const Common::String &viewName, const InfoMessage &msg)
 
bool send (const InfoMessage &msg)
 
bool send (const Common::String &viewName, const DrawGraphicMessage &msg)
 
bool send (const DrawGraphicMessage &msg)
 
- Public Member Functions inherited from MM::MM1::Mouse
void loadCursors ()
 
void setCursor (int cursorId)
 
void showCursor ()
 
void hideCursor ()
 
bool isCursorVisible () const
 

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
 
bool msgDrawGraphic (const DrawGraphicMessage &e) override
 
- Protected Member Functions inherited from MM::MM1::UIElement
Common::Rect getLineBounds (int line1, int line2) const
 
void delaySeconds (uint seconds)
 
void delayFrames (uint frames)
 
bool isDelayActive () const
 
void cancelDelay ()
 
bool endDelay ()
 
virtual void timeout ()
 
virtual bool msgGame (const GameMessage &e)
 
virtual bool msgHeader (const HeaderMessage &e)
 
virtual bool msgInfo (const InfoMessage &e)
 

Additional Inherited Members

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

Detailed Description

Main events and view manager

Member Function Documentation

◆ processEvent()

void MM::MM1::Events::processEvent ( Common::Event ev)
protected

Process an event

◆ shouldQuit()

virtual bool MM::MM1::Events::shouldQuit ( ) const
protectedpure virtual

Returns true if the game should quit

Implemented in MM::MM1::MM1Engine.

◆ runGame()

void MM::MM1::Events::runGame ( )

Main game loop

◆ replaceView()

void MM::MM1::Events::replaceView ( UIElement ui,
bool  replaceAllViews = false 
)

Sets the focus to a new view

◆ addView()

void MM::MM1::Events::addView ( UIElement ui)

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

◆ clearViews()

void MM::MM1::Events::clearViews ( )

Clears the view list

◆ popView()

void MM::MM1::Events::popView ( )

Pops a view from the view stack

◆ redrawViews()

void MM::MM1::Events::redrawViews ( )

Redraws the views in order. This is used in rare cases where a view draws outside it's defined area, and needs to restore whether the background was before

◆ focusedView()

UIElement* MM::MM1::Events::focusedView ( ) const
inline

Returns the currently focused view, if any

◆ priorView()

UIElement* MM::MM1::Events::priorView ( ) const
inline

Returns the view prior to the current view, if any

◆ isPresent()

bool MM::MM1::Events::isPresent ( const Common::String name) const

Returns true if a view of a given name is present at all in the visible view stack

◆ isInCombat()

bool MM::MM1::Events::isInCombat ( ) const
inline

Returns true if combat is active

◆ addKeypress()

void MM::MM1::Events::addKeypress ( const Common::KeyCode  kc)

Add a keypress to the event queue

◆ addAction()

void MM::MM1::Events::addAction ( KeybindingAction  action)

Add a action to the event queue

◆ isKeypressPending()

bool MM::MM1::Events::isKeypressPending ( ) const

Checks whether a keypress is pending

◆ draw()

void MM::MM1::Events::draw ( )
inlineoverridevirtual

Draws the element

Reimplemented from MM::MM1::UIElement.

◆ tick()

bool MM::MM1::Events::tick ( )
inlineoverridevirtual

Called for game frame ticks

Reimplemented from MM::MM1::UIElement.

◆ close()

void MM::MM1::Events::close ( )
inlineoverridevirtual

Calling the close method for g_events closes the active window

Reimplemented from MM::MM1::UIElement.


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