FifeGUI 0.2.0
A C++ GUI library designed for games.
fcn::Gui Class Reference

#include <gui.hpp>

Public Member Functions

virtual void addGlobalKeyListener (KeyListener *keyListener)
virtual void draw ()
void enqueueHiddenWidget (Widget *widget)
void enqueueShownWidget (Widget *widget)
virtual void focusNone ()
virtual FocusHandlergetFocusHandler () const
virtual GraphicsgetGraphics () const
virtual InputgetInput () const
virtual WidgetgetTop () const
 Gui (Gui &&)=delete
 Gui (Gui const &)=delete
virtual void initialize (std::unique_ptr< Graphics > graphics, std::unique_ptr< Input > input, int width, int height)
virtual bool isTabbingEnabled ()
virtual void logic ()
Gui & operator= (Gui &&)=delete
Gui & operator= (Gui const &)=delete
virtual void removeGlobalKeyListener (KeyListener *keyListener)
virtual void setGlobalFont (std::string const &filename, int size)
virtual void setGraphics (Graphics *graphics)
virtual void setGraphics (std::unique_ptr< Graphics > graphics)
virtual void setInput (Input *input)
virtual void setInput (std::unique_ptr< Input > input)
virtual void setRoot (std::unique_ptr< Widget > top)
virtual void setRoot (Widget *top)
virtual void setTabbingEnabled (bool tabbing)
virtual void setTop (std::unique_ptr< Widget > top)
virtual void setTop (Widget *top)
void widgetDied (Widget const *widget)

Protected Types

using KeyListenerList = std::list<KeyListener*>
using KeyListenerListIterator = KeyListenerList::iterator

Protected Member Functions

virtual void distributeKeyEvent (KeyEvent &keyEvent)
virtual void distributeKeyEventToGlobalKeyListeners (KeyEvent &keyEvent)
void distributeMouseEvent (Widget *source, MouseEvent::Type type, MouseEvent::Button button, int x, int y)
void distributeMouseEvent (Widget *source, MouseEvent::Type type, MouseEvent::Button button, int x, int y, bool force)
virtual void distributeMouseEvent (Widget *source, MouseEvent::Type type, MouseEvent::Button button, int x, int y, bool force, bool toSourceOnly)
virtual WidgetgetKeyEventSource ()
virtual WidgetgetMouseEventSource (int x, int y)
WidgetgetWidgetAt (int x, int y)
virtual WidgetgetWidgetAt (int x, int y, Widget *exclude)
virtual std::set< Widget * > getWidgetsAt (int x, int y)
virtual void handleHiddenWidgets ()
virtual void handleKeyInput ()
virtual void handleModalFocus ()
virtual void handleModalFocusGained ()
virtual void handleModalFocusReleased ()
virtual void handleModalMouseInputFocus ()
virtual void handleModalMouseInputFocusGained ()
virtual void handleModalMouseInputFocusReleased ()
virtual void handleMouseInput ()
virtual void handleMouseMoved (MouseInput const &mouseInput)
virtual void handleMousePressed (MouseInput const &mouseInput)
virtual void handleMouseReleased (MouseInput const &mouseInput)
virtual void handleMouseWheelMovedDown (MouseInput const &mouseInput)
virtual void handleMouseWheelMovedLeft (MouseInput const &mouseInput)
virtual void handleMouseWheelMovedRight (MouseInput const &mouseInput)
virtual void handleMouseWheelMovedUp (MouseInput const &mouseInput)
virtual void handleShownWidgets ()

Protected Attributes

bool mAltPressed
int mClickCount
bool mControlPressed
GuiDeathListenermDeathListener
FocusHandlermFocusHandler
std::shared_ptr< FontmGlobalFont
GraphicsmGraphics
std::queue< Widget * > mHiddenWidgets
InputmInput
KeyListenerList mKeyListeners
int mLastMouseDragButton
unsigned int mLastMousePressButton
int mLastMousePressTimeStamp
int mLastMouseX
int mLastMouseY
bool mMetaPressed
std::unique_ptr< GraphicsmOwnedGraphics
std::unique_ptr< InputmOwnedInput
std::unique_ptr< WidgetmOwnedTop
bool mShiftPressed
std::queue< Widget * > mShownWidgets
bool mTabbing
WidgetmTop
VisibilityEventHandlermVisibilityEventHandler

Detailed Description

The central GUI manager.

Integrates backend implementations and manages the root widget tree.

GUI is the core class of FifeGUI to which implementations of backends are passed, to make FifeGUI work with a specific library, and to where the top widget (root widget of GUI) is added. If you want to be able to have more then one widget in your GUI, the top widget should be a container.

A Gui object cannot work properly without passing backend implementations to it. A Gui object must have an implementation of a Graphics and an implementation of Input.

NOTE: A complete GUI also must have the ability to load images. Images are loaded with the Image class, so to make Fifechan able to load images an implementation of ImageLoader must be passed to Image.

See also
Graphics, Input, Image

Definition at line 100 of file gui.hpp.

Member Typedef Documentation

◆ KeyListenerList

using fcn::Gui::KeyListenerList = std::list<KeyListener*>
protected

Typedef.

Definition at line 569 of file gui.hpp.

◆ KeyListenerListIterator

using fcn::Gui::KeyListenerListIterator = KeyListenerList::iterator
protected

Typedef.

Definition at line 574 of file gui.hpp.

Constructor & Destructor Documentation

◆ Gui()

fcn::Gui::Gui ( )

Definition at line 61 of file gui.cpp.

◆ ~Gui()

fcn::Gui::~Gui ( )
virtual

Definition at line 85 of file gui.cpp.

Member Function Documentation

◆ addGlobalKeyListener()

void fcn::Gui::addGlobalKeyListener ( KeyListener * keyListener)
virtual

Adds a global key listener to the Gui.

A global key listener will receive all key events generated from the GUI and global key listeners will receive the events before key listeners of widgets.

Parameters
keyListenerThe key listener to add.
See also
removeGlobalKeyListener

Definition at line 260 of file gui.cpp.

References mKeyListeners.

◆ distributeKeyEvent()

void fcn::Gui::distributeKeyEvent ( KeyEvent & keyEvent)
protectedvirtual

◆ distributeKeyEventToGlobalKeyListeners()

void fcn::Gui::distributeKeyEventToGlobalKeyListeners ( KeyEvent & keyEvent)
protectedvirtual

Distributes a key event to the global key listeners.

Parameters
keyEventThe key event to distribute.

Definition at line 880 of file gui.cpp.

References fcn::KeyEvent::getType(), fcn::InputEvent::isConsumed(), and mKeyListeners.

Referenced by handleKeyInput().

◆ distributeMouseEvent() [1/3]

void fcn::Gui::distributeMouseEvent ( Widget * source,
MouseEvent::Type type,
MouseEvent::Button button,
int x,
int y )
inlineprotected

◆ distributeMouseEvent() [2/3]

void fcn::Gui::distributeMouseEvent ( Widget * source,
MouseEvent::Type type,
MouseEvent::Button button,
int x,
int y,
bool force )
inlineprotected

Convenience overload: forward and allow specifying force while toSourceOnly remains false.

Definition at line 440 of file gui.hpp.

References distributeMouseEvent().

◆ distributeMouseEvent() [3/3]

void fcn::Gui::distributeMouseEvent ( Widget * source,
MouseEvent::Type type,
MouseEvent::Button button,
int x,
int y,
bool force,
bool toSourceOnly )
protectedvirtual

Distributes a mouse event to the GUI handling code.

Parameters
sourceThe source widget of the event.
typeThe type of the event to distribute.
buttonThe button of the event (if any) to distribute.
xThe x coordinate of the event.
yThe y coordinate of the event.
forceIf true, distributes the event even if the receiving widget is not enabled, not visible, or another widget has modal focus.
toSourceOnlyIf true, only the source widget receives the event, otherwise parent listeners may also receive it.

Definition at line 730 of file gui.cpp.

References fcn::Widget::_getMouseListeners(), fcn::Widget::getAbsolutePosition(), fcn::Widget::getParent(), fcn::MouseEvent::getType(), fcn::Widget::isEnabled(), fcn::Widget::isModalFocused(), fcn::Widget::isModalMouseInputFocused(), mAltPressed, mClickCount, mControlPressed, fcn::InputEvent::mDistributor, mFocusHandler, mMetaPressed, mShiftPressed, fcn::MouseEvent::mX, fcn::MouseEvent::mY, and fcn::Widget::widgetExists().

◆ draw()

void fcn::Gui::draw ( )
virtual

Draws the GUI.

By calling this function all draw functions down in the GUI hierarchy will be called. When draw is called the used Graphics object will be initialised and drawing of the top widget will commence.

See also
Widget::draw

Definition at line 226 of file gui.cpp.

References mGraphics, and mTop.

◆ enqueueHiddenWidget()

void fcn::Gui::enqueueHiddenWidget ( Widget * widget)

Inform gui that a widget was hidden.

Parameters
widgetHidden widget.

Definition at line 270 of file gui.cpp.

References mHiddenWidgets.

◆ enqueueShownWidget()

void fcn::Gui::enqueueShownWidget ( Widget * widget)

Inform gui that a widget was shown.

Parameters
widgetShown widget.

Definition at line 275 of file gui.cpp.

References mShownWidgets.

◆ focusNone()

void fcn::Gui::focusNone ( )
virtual

Focuses none of the widgets in the Gui.

Definition at line 245 of file gui.cpp.

References mFocusHandler.

◆ getFocusHandler()

FocusHandler * fcn::Gui::getFocusHandler ( ) const
virtual

Returns the focus handler used by this GUI.

Returns
Focus handler.

Definition at line 184 of file gui.cpp.

References mFocusHandler.

◆ getGraphics()

Graphics * fcn::Gui::getGraphics ( ) const
virtual

Gets the graphics object used for drawing.

Returns
The graphics object used for drawing. Nullptr if no graphics object has been set.
See also
setGraphics, OpenGLGraphics, SDLGraphics

Definition at line 152 of file gui.cpp.

References mGraphics.

◆ getInput()

Input * fcn::Gui::getInput ( ) const
virtual

Gets the input object being used for input handling.

Returns
The input object used for handling input. Nullptr if no input object has been set.
See also
setInput, SDLInput

Definition at line 171 of file gui.cpp.

References mInput.

◆ getKeyEventSource()

Widget * fcn::Gui::getKeyEventSource ( )
protectedvirtual

Gets the source of the key event.

Returns
The source widget of the key event.

Definition at line 718 of file gui.cpp.

References fcn::Widget::_getInternalFocusHandler(), fcn::FocusHandler::getFocused(), and mFocusHandler.

Referenced by handleKeyInput().

◆ getMouseEventSource()

Widget * fcn::Gui::getMouseEventSource ( int x,
int y )
protectedvirtual

Gets the source of the mouse event.

Returns
The source widget of the mouse event.

Definition at line 707 of file gui.cpp.

References getWidgetAt(), fcn::Widget::isModalMouseInputFocused(), and mFocusHandler.

Referenced by handleMouseMoved(), handleMousePressed(), handleMouseReleased(), handleMouseWheelMovedDown(), handleMouseWheelMovedLeft(), handleMouseWheelMovedRight(), and handleMouseWheelMovedUp().

◆ getTop()

Widget * fcn::Gui::getTop ( ) const
virtual

Gets the top widget.

The top widget is the root widget of the GUI.

Returns
The top widget. Nullptr if no top widget has been set.

Definition at line 133 of file gui.cpp.

References mTop.

◆ getWidgetAt() [1/2]

Widget * fcn::Gui::getWidgetAt ( int x,
int y )
inlineprotected

Gets the widget at a certain position.

Returns
The widget at a certain position.

Definition at line 489 of file gui.hpp.

References getWidgetAt().

Referenced by getMouseEventSource(), getWidgetAt(), handleHiddenWidgets(), and handleShownWidgets().

◆ getWidgetAt() [2/2]

Widget * fcn::Gui::getWidgetAt ( int x,
int y,
Widget * exclude )
protectedvirtual

Gets the widget at a certain position, optionally excluding one widget.

Parameters
xThe x coordinate.
yThe y coordinate.
excludeWidget to ignore when searching (may be nullptr).
Returns
The widget at the specified position or nullptr if none.

Definition at line 672 of file gui.cpp.

References fcn::Widget::getAbsolutePosition(), fcn::Widget::getWidgetAt(), and mTop.

◆ getWidgetsAt()

std::set< Widget * > fcn::Gui::getWidgetsAt ( int x,
int y )
protectedvirtual

Gets all widgets a certain coordinate in the Gui.

Parameters
xThe x coordinate.
yThe y coordinate.
Returns
A set of all widgets at the specified coordinate.

Definition at line 690 of file gui.cpp.

References fcn::Widget::getAbsolutePosition(), fcn::Widget::getWidgetAt(), and mTop.

Referenced by handleModalFocusGained(), handleModalFocusReleased(), handleModalMouseInputFocusGained(), handleModalMouseInputFocusReleased(), and handleMouseMoved().

◆ handleHiddenWidgets()

◆ handleKeyInput()

◆ handleModalFocus()

void fcn::Gui::handleModalFocus ( )
protectedvirtual

Handles modal focus.

Modal focus needs to be checked at each logic iteration as it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 916 of file gui.cpp.

References handleModalFocusGained(), handleModalFocusReleased(), and mFocusHandler.

Referenced by logic().

◆ handleModalFocusGained()

void fcn::Gui::handleModalFocusGained ( )
protectedvirtual

Handles modal focus gained.

If modal focus has been gained it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 930 of file gui.cpp.

References distributeMouseEvent(), getWidgetsAt(), mFocusHandler, mLastMousePressButton, mLastMouseX, and mLastMouseY.

Referenced by handleModalFocus().

◆ handleModalFocusReleased()

void fcn::Gui::handleModalFocusReleased ( )
protectedvirtual

Handles modal focus released.

If modal focus has been released it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 953 of file gui.cpp.

References distributeMouseEvent(), getWidgetsAt(), mFocusHandler, mLastMousePressButton, mLastMouseX, and mLastMouseY.

Referenced by handleModalFocus().

◆ handleModalMouseInputFocus()

void fcn::Gui::handleModalMouseInputFocus ( )
protectedvirtual

Handles modal mouse input focus.

Modal mouse input focus needs to be checked at each logic iteration as it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 902 of file gui.cpp.

References handleModalMouseInputFocusGained(), handleModalMouseInputFocusReleased(), and mFocusHandler.

Referenced by logic().

◆ handleModalMouseInputFocusGained()

void fcn::Gui::handleModalMouseInputFocusGained ( )
protectedvirtual

Handles modal mouse input focus gained.

If modal focus has been gained it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 973 of file gui.cpp.

References distributeMouseEvent(), getWidgetsAt(), mFocusHandler, mLastMousePressButton, mLastMouseX, and mLastMouseY.

Referenced by handleModalMouseInputFocus().

◆ handleModalMouseInputFocusReleased()

void fcn::Gui::handleModalMouseInputFocusReleased ( )
protectedvirtual

Handles modal mouse input focus released.

If modal focus has been released it might be necessary to distribute mouse entered or mouse exited events.

Definition at line 996 of file gui.cpp.

References distributeMouseEvent(), getWidgetsAt(), mFocusHandler, mLastMousePressButton, mLastMouseX, and mLastMouseY.

Referenced by handleModalMouseInputFocus().

◆ handleMouseInput()

◆ handleMouseMoved()

void fcn::Gui::handleMouseMoved ( MouseInput const & mouseInput)
protectedvirtual

◆ handleMousePressed()

◆ handleMouseReleased()

void fcn::Gui::handleMouseReleased ( MouseInput const & mouseInput)
protectedvirtual

Handles mouse released input.

Parameters
mouseInputThe mouse input to handle.

Definition at line 629 of file gui.cpp.

References distributeMouseEvent(), fcn::Widget::getAbsolutePosition(), fcn::MouseInput::getButton(), getMouseEventSource(), fcn::MouseInput::getX(), fcn::MouseInput::getY(), mClickCount, mFocusHandler, and mLastMousePressButton.

Referenced by handleMouseInput().

◆ handleMouseWheelMovedDown()

void fcn::Gui::handleMouseWheelMovedDown ( MouseInput const & mouseInput)
protectedvirtual

Handles mouse wheel moved down input.

Parameters
mouseInputThe mouse input to handle.

Definition at line 549 of file gui.cpp.

References distributeMouseEvent(), fcn::Widget::getAbsolutePosition(), fcn::MouseInput::getButton(), getMouseEventSource(), fcn::MouseInput::getX(), fcn::MouseInput::getY(), and mFocusHandler.

Referenced by handleMouseInput().

◆ handleMouseWheelMovedLeft()

void fcn::Gui::handleMouseWheelMovedLeft ( MouseInput const & mouseInput)
protectedvirtual

Handles mouse wheel moved left input.

Parameters
mouseInputThe mouse input to handle.

Definition at line 609 of file gui.cpp.

References distributeMouseEvent(), fcn::Widget::getAbsolutePosition(), fcn::MouseInput::getButton(), getMouseEventSource(), fcn::MouseInput::getX(), fcn::MouseInput::getY(), and mFocusHandler.

Referenced by handleMouseInput().

◆ handleMouseWheelMovedRight()

void fcn::Gui::handleMouseWheelMovedRight ( MouseInput const & mouseInput)
protectedvirtual

Handles mouse wheel moved right input.

Parameters
mouseInputThe mouse input to handle.

Definition at line 589 of file gui.cpp.

References distributeMouseEvent(), fcn::Widget::getAbsolutePosition(), fcn::MouseInput::getButton(), getMouseEventSource(), fcn::MouseInput::getX(), fcn::MouseInput::getY(), and mFocusHandler.

Referenced by handleMouseInput().

◆ handleMouseWheelMovedUp()

void fcn::Gui::handleMouseWheelMovedUp ( MouseInput const & mouseInput)
protectedvirtual

Handles mouse wheel moved up input.

Parameters
mouseInputThe mouse input to handle.

Definition at line 569 of file gui.cpp.

References distributeMouseEvent(), fcn::Widget::getAbsolutePosition(), fcn::MouseInput::getButton(), getMouseEventSource(), fcn::MouseInput::getX(), fcn::MouseInput::getY(), and mFocusHandler.

Referenced by handleMouseInput().

◆ handleShownWidgets()

void fcn::Gui::handleShownWidgets ( )
protectedvirtual

◆ initialize()

void fcn::Gui::initialize ( std::unique_ptr< Graphics > graphics,
std::unique_ptr< Input > input,
int width,
int height )
virtual

Initializes GUI backends in one call.

Parameters
Graphics & RenderingOwned graphics backend.
Input HandlingOwned input backend.
widthUnused by the core implementation.
heightUnused by the core implementation.

Definition at line 176 of file gui.cpp.

References setGraphics(), and setInput().

◆ isTabbingEnabled()

bool fcn::Gui::isTabbingEnabled ( )
virtual

Checks if tabbing is enabled.

Returns
True if tabbing is enabled, false otherwise.
See also
setTabbingEnabled

Definition at line 255 of file gui.cpp.

References mTabbing.

◆ logic()

void fcn::Gui::logic ( )
virtual

Performs logic of the GUI.

By calling this function all logic functions down in the GUI heirarchy will be called. When logic is called for Gui, user input will be handled.

See also
Widget::logic

Definition at line 204 of file gui.cpp.

References handleHiddenWidgets(), handleKeyInput(), handleModalFocus(), handleModalMouseInputFocus(), handleMouseInput(), handleShownWidgets(), mInput, and mTop.

◆ removeGlobalKeyListener()

void fcn::Gui::removeGlobalKeyListener ( KeyListener * keyListener)
virtual

Removes global key listener from the Gui.

Parameters
keyListenerThe key listener to remove.
Exceptions
Exceptionif the key listener hasn't been added.
See also
addGlobalKeyListener

Definition at line 265 of file gui.cpp.

References mKeyListeners.

◆ setGlobalFont()

void fcn::Gui::setGlobalFont ( std::string const & filename,
int size )
virtual

Loads a font using the active graphics backend and sets it as global widget font.

Parameters
filenamePath to font file.
sizeFont size.

Definition at line 189 of file gui.cpp.

References mGlobalFont, mGraphics, and fcn::Widget::setGlobalFont().

◆ setGraphics() [1/2]

void fcn::Gui::setGraphics ( Graphics * graphics)
virtual

Sets the graphics object to use for drawing.

Parameters
Graphics & RenderingThe graphics object to use for drawing.
See also
getGraphics, OpenGLGraphics, SDLGraphics

Definition at line 138 of file gui.cpp.

References mGraphics, and mOwnedGraphics.

Referenced by initialize(), and setGraphics().

◆ setGraphics() [2/2]

void fcn::Gui::setGraphics ( std::unique_ptr< Graphics > graphics)
virtual

Sets and owns the graphics object used for drawing.

Parameters
Graphics & RenderingThe graphics object.

Definition at line 146 of file gui.cpp.

References mOwnedGraphics, and setGraphics().

◆ setInput() [1/2]

void fcn::Gui::setInput ( Input * input)
virtual

Sets the input object to use for input handling.

Parameters
Input HandlingThe input object to use for input handling.
See also
getInput, SDLInput

Definition at line 157 of file gui.cpp.

References mInput, and mOwnedInput.

Referenced by initialize(), and setInput().

◆ setInput() [2/2]

void fcn::Gui::setInput ( std::unique_ptr< Input > input)
virtual

Sets and owns the input object used for input handling.

Parameters
Input HandlingThe input object.

Definition at line 165 of file gui.cpp.

References mOwnedInput, and setInput().

◆ setRoot() [1/2]

void fcn::Gui::setRoot ( std::unique_ptr< Widget > top)
virtual

Alias for ownership-based setTop.

Parameters
topThe root widget to own.

Definition at line 128 of file gui.cpp.

References setTop().

◆ setRoot() [2/2]

void fcn::Gui::setRoot ( Widget * top)
virtual

Alias for setTop.

Parameters
topThe root widget.

Definition at line 123 of file gui.cpp.

References setTop().

◆ setTabbingEnabled()

void fcn::Gui::setTabbingEnabled ( bool tabbing)
virtual

Sets tabbing enabled, or not.

Tabbing is the usage of changing focus by utilizing the tab key.

Parameters
tabbingTrue if tabbing should be enabled, false otherwise.
See also
isTabbingEnabled

Definition at line 250 of file gui.cpp.

References mTabbing.

◆ setTop() [1/2]

void fcn::Gui::setTop ( std::unique_ptr< Widget > top)
virtual

Sets the root widget and transfers ownership to Gui.

Parameters
topThe root widget to own.

Definition at line 117 of file gui.cpp.

References mOwnedTop, and setTop().

◆ setTop() [2/2]

void fcn::Gui::setTop ( Widget * top)
virtual

Sets the top widget.

The top widget is the root widget of the GUI. If you want a GUI to be able to contain more than one widget the top widget should be a container.

Parameters
topThe top widget.
See also
Container

Definition at line 101 of file gui.cpp.

References fcn::Widget::_setFocusHandler(), mFocusHandler, mOwnedTop, and mTop.

Referenced by setRoot(), setRoot(), and setTop().

◆ widgetDied()

void fcn::Gui::widgetDied ( Widget const * widget)

Inform gui that a widget was deleted.

Parameters
widgetDeleted widget.

Definition at line 280 of file gui.cpp.

References mHiddenWidgets, and mShownWidgets.

Member Data Documentation

◆ mAltPressed

bool fcn::Gui::mAltPressed
protected

True if alt is pressed, false otherwise.

Definition at line 599 of file gui.hpp.

Referenced by distributeMouseEvent(), and handleKeyInput().

◆ mClickCount

int fcn::Gui::mClickCount
protected

Holds the current click count.

Used to keep track of clicks for a the last pressed button.

Definition at line 625 of file gui.hpp.

Referenced by distributeMouseEvent(), handleMouseMoved(), handleMousePressed(), and handleMouseReleased().

◆ mControlPressed

bool fcn::Gui::mControlPressed
protected

True if control is pressed, false otherwise.

Definition at line 594 of file gui.hpp.

Referenced by distributeMouseEvent(), and handleKeyInput().

◆ mDeathListener

GuiDeathListener* fcn::Gui::mDeathListener
protected

Listener notified when the GUI or top widget is destroyed.

Definition at line 635 of file gui.hpp.

◆ mFocusHandler

◆ mGlobalFont

std::shared_ptr<Font> fcn::Gui::mGlobalFont
protected

Shared global font used by widgets when not overridden.

Definition at line 647 of file gui.hpp.

Referenced by setGlobalFont().

◆ mGraphics

Graphics* fcn::Gui::mGraphics
protected

Holds the graphics implementation used.

Definition at line 544 of file gui.hpp.

Referenced by draw(), getGraphics(), setGlobalFont(), and setGraphics().

◆ mHiddenWidgets

std::queue<Widget*> fcn::Gui::mHiddenWidgets
protected

Holds hidden widgets.

Definition at line 534 of file gui.hpp.

Referenced by enqueueHiddenWidget(), handleHiddenWidgets(), and widgetDied().

◆ mInput

Input* fcn::Gui::mInput
protected

Holds the input implementation used.

Definition at line 549 of file gui.hpp.

Referenced by getInput(), handleKeyInput(), handleMouseInput(), logic(), and setInput().

◆ mKeyListeners

KeyListenerList fcn::Gui::mKeyListeners
protected

Holds the global key listeners of the Gui.

Definition at line 579 of file gui.hpp.

Referenced by addGlobalKeyListener(), distributeKeyEventToGlobalKeyListeners(), and removeGlobalKeyListener().

◆ mLastMouseDragButton

int fcn::Gui::mLastMouseDragButton
protected

Holds the last button used when a drag of a widget was initiated.

Used to be able to release a drag when the same button is released.

Definition at line 632 of file gui.hpp.

Referenced by handleMouseMoved(), and handleMousePressed().

◆ mLastMousePressButton

unsigned int fcn::Gui::mLastMousePressButton
protected

◆ mLastMousePressTimeStamp

int fcn::Gui::mLastMousePressTimeStamp
protected

Holds the last mouse press time stamp.

Definition at line 609 of file gui.hpp.

Referenced by handleMouseMoved(), and handleMousePressed().

◆ mLastMouseX

◆ mLastMouseY

◆ mMetaPressed

bool fcn::Gui::mMetaPressed
protected

True if meta is pressed, false otherwise.

Definition at line 589 of file gui.hpp.

Referenced by distributeMouseEvent(), and handleKeyInput().

◆ mOwnedGraphics

std::unique_ptr<Graphics> fcn::Gui::mOwnedGraphics
protected

Optional owned graphics backend instance.

Definition at line 641 of file gui.hpp.

Referenced by setGraphics(), and setGraphics().

◆ mOwnedInput

std::unique_ptr<Input> fcn::Gui::mOwnedInput
protected

Optional owned input backend instance.

Definition at line 644 of file gui.hpp.

Referenced by setInput(), and setInput().

◆ mOwnedTop

std::unique_ptr<Widget> fcn::Gui::mOwnedTop
protected

Optional owned top widget (when Gui takes ownership).

Definition at line 638 of file gui.hpp.

Referenced by setTop(), and setTop().

◆ mShiftPressed

bool fcn::Gui::mShiftPressed
protected

True if shift is pressed, false otherwise.

Definition at line 584 of file gui.hpp.

Referenced by distributeMouseEvent(), and handleKeyInput().

◆ mShownWidgets

std::queue<Widget*> fcn::Gui::mShownWidgets
protected

Holds shown widgets.

Definition at line 539 of file gui.hpp.

Referenced by enqueueShownWidget(), handleShownWidgets(), and widgetDied().

◆ mTabbing

bool fcn::Gui::mTabbing
protected

True if tabbing is enabled, false otherwise.

Definition at line 564 of file gui.hpp.

Referenced by handleKeyInput(), isTabbingEnabled(), and setTabbingEnabled().

◆ mTop

Widget* fcn::Gui::mTop
protected

Holds the top widget.

Definition at line 529 of file gui.hpp.

Referenced by draw(), getTop(), getWidgetAt(), getWidgetsAt(), handleMouseMoved(), logic(), and setTop().

◆ mVisibilityEventHandler

VisibilityEventHandler* fcn::Gui::mVisibilityEventHandler
protected

Holds the visibility event handler for the Gui.

Definition at line 559 of file gui.hpp.


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