Mana
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Gui Class Referencefinal

Main GUI class. More...

#include <gui.h>

Inheritance diagram for Gui:
EventListener

Public Member Functions

 Gui (Graphics *screen, const std::string &themePath)
 
 ~Gui () override
 
void logic () override
 Performs logic of the GUI.
 
void event (Event::Channel channel, const Event &event) override
 
bool videoResized (int width, int height)
 Called when the application window has been resized.
 
gcn::FocusHandler * getFocusHandler () const
 
gcn::Font * getFont () const
 Return game font.
 
gcn::Font * getInfoParticleFont () const
 Return the Font used for "Info Particles", i.e.
 
void setUseCustomCursor (bool customCursor)
 Sets whether a custom cursor should be rendered.
 
void setCursorType (Cursor cursor)
 Sets which cursor should be used.
 
const std::vector< ThemeInfo > & getAvailableThemes () const
 
void setTheme (const ThemeInfo &theme)
 Sets the global GUI theme.
 
ThemegetTheme () const
 The global GUI theme.
 
- Public Member Functions inherited from EventListener
virtual ~EventListener ()
 
void listen (Event::Channel channel)
 
void ignore (Event::Channel channel)
 

Static Public Attributes

static bool debugDraw
 

Protected Member Functions

void handleMouseMoved (const gcn::MouseInput &mouseInput) override
 
void handleTextInput (const TextInput &textInput)
 

Private Member Functions

void updateCursor ()
 
void loadCustomCursors ()
 
void loadSystemCursors ()
 

Private Attributes

std::vector< ThemeInfomAvailableThemes
 
std::unique_ptr< ThememTheme
 The global GUI theme.
 
gcn::Font * mGuiFont
 The global GUI font.
 
gcn::Font * mInfoParticleFont
 Font for Info Particles.
 
bool mCustomCursor = false
 Show custom cursor.
 
float mCustomCursorScale = 1.0f
 
std::vector< SDL_Cursor * > mSystemMouseCursors
 
std::vector< SDL_Cursor * > mCustomMouseCursors
 
Timer mMouseActivityTimer
 
Cursor mCursorType = Cursor::Pointer
 

Detailed Description

Main GUI class.

Definition at line 79 of file gui.h.

Constructor & Destructor Documentation

◆ Gui()

Gui::Gui ( Graphics screen,
const std::string &  themePath 
)

Definition at line 61 of file gui.cpp.

◆ ~Gui()

Gui::~Gui ( )
override

Definition at line 150 of file gui.cpp.

Member Function Documentation

◆ event()

void Gui::event ( Event::Channel  channel,
const Event event 
)
overridevirtual

Implements EventListener.

Definition at line 184 of file gui.cpp.

◆ getAvailableThemes()

const std::vector< ThemeInfo > & Gui::getAvailableThemes ( ) const
inline

Definition at line 127 of file gui.h.

◆ getFocusHandler()

gcn::FocusHandler * Gui::getFocusHandler ( ) const
inline

Definition at line 101 of file gui.h.

◆ getFont()

gcn::Font * Gui::getFont ( ) const
inline

Return game font.

Definition at line 107 of file gui.h.

◆ getInfoParticleFont()

gcn::Font * Gui::getInfoParticleFont ( ) const
inline

Return the Font used for "Info Particles", i.e.

ones showing, what you picked up, etc.

Definition at line 114 of file gui.h.

◆ getTheme()

Theme * Gui::getTheme ( ) const
inline

The global GUI theme.

Definition at line 138 of file gui.h.

◆ handleMouseMoved()

void Gui::handleMouseMoved ( const gcn::MouseInput &  mouseInput)
overrideprotected

Definition at line 253 of file gui.cpp.

◆ handleTextInput()

void Gui::handleTextInput ( const TextInput textInput)
protected

Definition at line 262 of file gui.cpp.

◆ loadCustomCursors()

void Gui::loadCustomCursors ( )
private

Definition at line 280 of file gui.cpp.

◆ loadSystemCursors()

void Gui::loadSystemCursors ( )
private

Definition at line 330 of file gui.cpp.

◆ logic()

void Gui::logic ( )
override

Performs logic of the GUI.

Overridden to track mouse pointer activity.

Definition at line 167 of file gui.cpp.

◆ setCursorType()

void Gui::setCursorType ( Cursor  cursor)

Sets which cursor should be used.

Definition at line 231 of file gui.cpp.

◆ setTheme()

void Gui::setTheme ( const ThemeInfo theme)

Sets the global GUI theme.

Definition at line 240 of file gui.cpp.

◆ setUseCustomCursor()

void Gui::setUseCustomCursor ( bool  customCursor)

Sets whether a custom cursor should be rendered.

Definition at line 222 of file gui.cpp.

◆ updateCursor()

void Gui::updateCursor ( )
private

Definition at line 245 of file gui.cpp.

◆ videoResized()

bool Gui::videoResized ( int  width,
int  height 
)

Called when the application window has been resized.

Returns whether the top widget changed size.

Definition at line 196 of file gui.cpp.

Member Data Documentation

◆ debugDraw

bool Gui::debugDraw
static

Definition at line 141 of file gui.h.

◆ mAvailableThemes

std::vector<ThemeInfo> Gui::mAvailableThemes
private

Definition at line 153 of file gui.h.

◆ mCursorType

Cursor Gui::mCursorType = Cursor::Pointer
private

Definition at line 162 of file gui.h.

◆ mCustomCursor

bool Gui::mCustomCursor = false
private

Show custom cursor.

Definition at line 157 of file gui.h.

◆ mCustomCursorScale

float Gui::mCustomCursorScale = 1.0f
private

Definition at line 158 of file gui.h.

◆ mCustomMouseCursors

std::vector<SDL_Cursor *> Gui::mCustomMouseCursors
private

Definition at line 160 of file gui.h.

◆ mGuiFont

gcn::Font* Gui::mGuiFont
private

The global GUI font.

Definition at line 155 of file gui.h.

◆ mInfoParticleFont

gcn::Font* Gui::mInfoParticleFont
private

Font for Info Particles.

Definition at line 156 of file gui.h.

◆ mMouseActivityTimer

Timer Gui::mMouseActivityTimer
private

Definition at line 161 of file gui.h.

◆ mSystemMouseCursors

std::vector<SDL_Cursor *> Gui::mSystemMouseCursors
private

Definition at line 159 of file gui.h.

◆ mTheme

std::unique_ptr<Theme> Gui::mTheme
private

The global GUI theme.

Definition at line 154 of file gui.h.


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