xoreos  0.0.5
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
Engines::GUI Class Reference

A GUI. More...

#include <gui.h>

Inheritance diagram for Engines::GUI:
Inheritance graph
[legend]
Collaboration diagram for Engines::GUI:
Collaboration graph
[legend]

Public Member Functions

 GUI (Console *console=0)
 
virtual ~GUI ()
 
virtual void show ()
 Show the GUI. More...
 
virtual void hide ()
 Hide the GUI. More...
 
uint32 run (uint32 startCode=kStartCodeNone)
 Run the GUI. More...
 
virtual void abort ()
 Abort the currently running GUI. More...
 
void addEvent (const Events::Event &event)
 Add a single event for consideration into the GUI event queue. More...
 
uint32 processEventQueue ()
 Process the current event queue. More...
 
virtual Common::UString getName () const
 

Static Public Attributes

static const uint32 kStartCodeNone = 0
 
static const uint32 kReturnCodeNone = 0
 
static const uint32 kReturnCodeAbort = 0xFFFFFFFF
 

Protected Member Functions

void addWidget (Widget *widget)
 Add a widget. More...
 
void removeWidget (Widget *widget)
 Remove a widget. More...
 
void clearWidgets ()
 Clear all widgets. More...
 
bool empty ()
 Check if the gui is currently empty. More...
 
bool hasWidget (const Common::UString &tag) const
 Does this specific widget exist within the GUI? More...
 
WidgetgetWidget (const Common::UString &tag, bool vital=false)
 Return a widget in the GUI. More...
 
const WidgetgetWidget (const Common::UString &tag, bool vital=false) const
 Return a widget in the GUI. More...
 
void declareGroup (const std::list< Widget *> &group)
 Put these widgets together into a group. More...
 
void removeFocus ()
 Forcefully remove the focus from the current widget. More...
 
void updateMouse ()
 Force an update of the mouse position. More...
 
virtual void mouseUp ()
 The mouse state has changed. More...
 
virtual void mouseDown ()
 
uint32 sub (GUI &gui, uint32 startCode=kStartCodeNone, bool showSelf=true, bool hideSelf=true)
 Open up a sub GUI. More...
 
void setPosition (float x, float y, float z)
 Set the GUI's position. More...
 
void getPosition (float &x, float &y, float &z) const
 Get the GUI's position. More...
 
virtual void callbackRun ()
 Callback that's triggered periodically in the run() method. More...
 
virtual void callbackActive (Widget &widget)
 Callback that's triggered when a widget was activated. More...
 
virtual void callbackTextInput (const Common::UString &text)
 Callback that's triggered when a text input is received. More...
 
virtual void callbackKeyInput (const Events::Key &key, const Events::EventType &type)
 Callback that's triggered when a key is pressed or released. More...
 
void addChild (GUI *gui)
 Add a child GUI object to this GUI. More...
 
void removeChild (GUI *gui)
 Remove a child GUI object from this GUI. More...
 

Protected Attributes

Console_console
 
Widget_currentWidget
 The widget the mouse is currently on. More...
 
uint32 _startCode
 The GUI's start code. More...
 
uint32 _returnCode
 The GUI's return code. More...
 
GUI_sub
 The currently running sub GUI. More...
 

Private Types

typedef std::list< Widget * > WidgetList
 
typedef std::map< Common::UString, Widget * > WidgetMap
 

Private Member Functions

WidgetgetWidgetAt (float x, float y)
 Return the widget at that position. More...
 
void changedWidget (Widget *widget)
 The current widget has changed. More...
 
void checkWidgetActive (Widget *widget)
 Check if a widget was activated. More...
 
void mouseMove (const Events::Event &event)
 Mouse move event triggered. More...
 
void mouseDown (const Events::Event &event)
 Mouse down event triggered. More...
 
void mouseUp (const Events::Event &event)
 Mouse up event triggered. More...
 
void mouseWheel (const Events::Event &event)
 Mouse wheel event triggered. More...
 
void textInput (const Events::Event &event)
 Text input event received. More...
 
void keyDown (const Events::Event &event)
 Key down event triggered. More...
 
void keyUp (const Events::Event &event)
 Key up event triggeered. More...
 
float toGUIX (int x)
 
float toGUIY (int y)
 
void mouseMove (Widget *widget, const Events::Event &event)
 Send a mouse move event to the widget. More...
 
void mouseDown (Widget *widget, const Events::Event &event)
 Send a mouse down event to the widget. More...
 
void mouseUp (Widget *widget, const Events::Event &event)
 Send a mouse up event to the widget. More...
 
void mouseWheel (Widget *widget, const Events::Event &event)
 Send a mouse wheel event to the widget. More...
 

Private Attributes

std::list< GUI * > _childGUIs
 
WidgetList _widgets
 All widgets in the GUI. More...
 
WidgetMap _widgetMap
 All widgets in the GUI, index by their tag. More...
 
float _x
 The GUI X position. More...
 
float _y
 The GUI Y position. More...
 
float _z
 The GUI Z position. More...
 
std::list< Events::Event_eventQueue
 The GUI event queue. More...
 

Friends

class Widget
 

Detailed Description

A GUI.

Definition at line 43 of file gui.h.

Member Typedef Documentation

◆ WidgetList

typedef std::list<Widget *> Engines::GUI::WidgetList
private

Definition at line 135 of file gui.h.

◆ WidgetMap

typedef std::map<Common::UString, Widget *> Engines::GUI::WidgetMap
private

Definition at line 136 of file gui.h.

Constructor & Destructor Documentation

◆ GUI()

Engines::GUI::GUI ( Console console = 0)

Definition at line 46 of file gui.cpp.

◆ ~GUI()

Engines::GUI::~GUI ( )
virtual

Reimplemented in Engines::Jade::GUI, Engines::KotOR::GUI, and Engines::NWN::GUI.

Definition at line 52 of file gui.cpp.

References _widgets.

Member Function Documentation

◆ abort()

void Engines::GUI::abort ( )
virtual

Abort the currently running GUI.

Reimplemented in Engines::NWN::MainMenu.

Definition at line 156 of file gui.cpp.

References _returnCode, _sub, abort(), and kReturnCodeAbort.

Referenced by Engines::NWN::MainMenu::abort(), and abort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addChild()

void Engines::GUI::addChild ( GUI gui)
protected

◆ addEvent()

void Engines::GUI::addEvent ( const Events::Event event)

Add a single event for consideration into the GUI event queue.

Definition at line 163 of file gui.cpp.

References _eventQueue.

Referenced by run().

Here is the caller graph for this function:

◆ addWidget()

void Engines::GUI::addWidget ( Widget widget)
protected

◆ callbackActive()

void Engines::GUI::callbackActive ( Widget widget)
protectedvirtual

Callback that's triggered when a widget was activated.

Reimplemented in Engines::KotOR::Menu, Engines::NWN::NewPremiumMenu, Engines::NWN::NewModuleMenu, Engines::KotOR::HUD, Engines::Jade::OptionsMenu, Engines::NWN::CharSpells, Engines::NWN::CharPremadeMenu, Engines::NWN::CharFeats, Engines::NWN::CharSkills, Engines::NWN::Quickbar, Engines::NWN::Quickchat, Engines::NWN::CharDomain, Engines::NWN::CharInfoVoice, Engines::NWN::CharPortrait, Engines::NWN::PartyLeader, Engines::KotOR::SaveLoadMenu, Engines::KotOR::DialogGUIBase, Engines::NWN::CharAttributes, Engines::KotOR::ClassSelectionMenu, Engines::NWN::Compass, Engines::KotOR::CharacterGenerationBaseMenu, Engines::KotOR::MenuEquipment, Engines::KotOR::MenuOptions, Engines::NWN::OptionsResolutionMenu, Engines::KotOR::MainMenu, Engines::NWN::CharGenMenu, Engines::NWN::CharPackage, Engines::NWN::OKCancelDialog, Engines::NWN::YesNoCancelDialog, Engines::NWN::MainMenu, Engines::KotOR::OptionsMenu, Engines::NWN::CharAlignment, Engines::NWN::CharClass, Engines::NWN::OptionsGameMenu, Engines::NWN::OptionsSoundMenu, Engines::NWN::CharRace, Engines::NWN::CharSchool, Engines::NWN::CharSex, Engines::NWN::IngameMainMenu, Engines::Jade::MainMenu, Engines::KotOR::MenuMap, Engines::KotOR2::ClassSelection, Engines::NWN::CharAppearance, Engines::NWN::CharFeatsPopup, Engines::NWN::CharHelp, Engines::NWN::OptionsMenu, Engines::NWN::OptionsVideoMenu, Engines::NWN::OptionsVideoAdvancedMenu, Engines::KotOR::ContainerMenu, Engines::NWN::CharTypeMenu, Engines::NWN::NewMenu, Engines::NWN::NewCampMenu, Engines::NWN::OptionsFeedbackMenu, Engines::KotOR::ConfirmDialog, Engines::KotOR::OptionsGameplayMenu, Engines::KotOR::OptionsGraphicsMenu, Engines::KotOR2::CharacterGenerationNameMenu, Engines::KotOR2::MainMenu, Engines::NWN::NewXP1Menu, Engines::NWN::NewXP2Menu, Engines::KotOR::CharacterGenerationNameMenu, Engines::KotOR::CharacterGenerationPortraitMenu, Engines::KotOR::PartySelectionGUI, Engines::NWN::MoviesCampMenu, Engines::NWN::OptionsSoundAdvancedMenu, Engines::KotOR::QuickOrCustomPanel, Engines::KotOR::OptionsAutoPauseMenu, Engines::KotOR::OptionsGraphicsAdvancedMenu, Engines::KotOR::OptionsMouseSettingsMenu, Engines::KotOR::OptionsSoundMenu, Engines::KotOR::OptionsSoundAdvancedMenu, Engines::KotOR::CustomCharPanel, Engines::KotOR::QuickCharPanel, Engines::KotOR::MoviesMenu, Engines::KotOR::OptionsResolutionMenu, Engines::KotOR2::QuickCharPanel, Engines::NWN::MoviesBaseMenu, Engines::NWN::OptionsControlsMenu, Engines::NWN::OptionsGorePasswordMenu, Engines::KotOR::OptionsFeedbackMenu, Engines::KotOR::OptionsKeyboardConfigurationMenu, Engines::KotOR2::CustomCharPanel, Engines::KotOR2::QuickOrCustomPanel, Engines::Jade::AudioOptionsMenu, Engines::Jade::ControlOptionsMenu, Engines::Jade::DifficultyOptionsMenu, Engines::Jade::GameInfoOptionsMenu, Engines::Jade::VideoOptionsMenu, Engines::KotOR::MenuAbilities, Engines::KotOR::MenuCharacter, Engines::KotOR::MenuInventory, Engines::KotOR::MenuJournal, Engines::KotOR::MenuMessages, and Engines::KotOR2::CharacterGenerationPortraitMenu.

Definition at line 231 of file gui.cpp.

Referenced by checkWidgetActive(), and Engines::Widget::raiseCallbackActive().

Here is the caller graph for this function:

◆ callbackKeyInput()

void Engines::GUI::callbackKeyInput ( const Events::Key key,
const Events::EventType type 
)
protectedvirtual

◆ callbackRun()

void Engines::GUI::callbackRun ( )
protectedvirtual

Callback that's triggered periodically in the run() method.

Reimplemented in Engines::KotOR::Menu, Engines::Jade::OptionsMenu, Engines::NWN::CharFeats, Engines::KotOR::ClassSelectionMenu, Engines::KotOR::MenuEquipment, and Engines::KotOR2::ClassSelection.

Definition at line 227 of file gui.cpp.

References _startCode, and kStartCodeNone.

Referenced by run().

Here is the caller graph for this function:

◆ callbackTextInput()

void Engines::GUI::callbackTextInput ( const Common::UString text)
protectedvirtual

Callback that's triggered when a text input is received.

Reimplemented in Engines::KotOR2::CharacterGenerationNameMenu, and Engines::KotOR::CharacterGenerationNameMenu.

Definition at line 234 of file gui.cpp.

Referenced by textInput().

Here is the caller graph for this function:

◆ changedWidget()

void Engines::GUI::changedWidget ( Widget widget)
private

The current widget has changed.

Definition at line 456 of file gui.cpp.

References _currentWidget, Engines::Widget::enter(), and Engines::Widget::leave().

Referenced by mouseDown(), mouseMove(), mouseUp(), mouseWheel(), and removeFocus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkWidgetActive()

void Engines::GUI::checkWidgetActive ( Widget widget)
private

Check if a widget was activated.

Definition at line 469 of file gui.cpp.

References Engines::Widget::_owner, callbackActive(), Engines::Widget::isActive(), Engines::Widget::setActive(), and Engines::Widget::subActive().

Referenced by mouseMove(), and mouseUp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearWidgets()

void Engines::GUI::clearWidgets ( )
protected

Clear all widgets.

Definition at line 295 of file gui.cpp.

References _widgetMap, and _widgets.

Referenced by Engines::KotOR::GUI::load().

Here is the caller graph for this function:

◆ declareGroup()

void Engines::GUI::declareGroup ( const std::list< Widget *> &  group)
protected

◆ empty()

bool Engines::GUI::empty ( )
protected

Check if the gui is currently empty.

Definition at line 306 of file gui.cpp.

References _widgets.

Referenced by Engines::KotOR::GUI::load(), and Engines::NWN::CharSpells::showSpellLevel().

Here is the caller graph for this function:

◆ getName()

Common::UString Engines::GUI::getName ( ) const
virtual

Reimplemented in Engines::Jade::GUI, and Engines::KotOR::GUI.

Definition at line 223 of file gui.cpp.

◆ getPosition()

void Engines::GUI::getPosition ( float &  x,
float &  y,
float &  z 
) const
protected

Get the GUI's position.

Definition at line 416 of file gui.cpp.

References _x, _y, and _z.

Referenced by sub().

Here is the caller graph for this function:

◆ getWidget() [1/2]

Widget * Engines::GUI::getWidget ( const Common::UString tag,
bool  vital = false 
)
protected

Return a widget in the GUI.

Definition at line 314 of file gui.cpp.

References _widgetMap, and Common::UString::c_str().

Referenced by addWidget(), Engines::NWN::CharAppearance::adjustButtons(), Engines::KotOR::ClassSelectionMenu::callbackKeyInput(), Engines::KotOR::CharacterGenerationMenu::callbackKeyInput(), Engines::KotOR::CharacterGenerationMenu::CharacterGenerationMenu(), Engines::NWN::CharGenMenu::CharGenMenu(), Engines::NWN::CharInfoVoice::CharInfoVoice(), Engines::NWN::CharPremadeMenu::CharPremadeMenu(), Engines::NWN::CharRace::CharRace(), Engines::NWN::GUI::getButton(), Engines::KotOR::GUI::getButton(), Engines::Jade::GUI::getButton(), Engines::NWN::GUI::getCheckBox(), Engines::KotOR::GUI::getCheckBox(), Engines::Jade::GUI::getCheckBox(), Engines::NWN::GUI::getClose(), Engines::NWN::GUI::getEditBox(), Engines::NWN::GUI::getFrame(), Engines::NWN::GUI::getLabel(), Engines::Jade::GUI::getLabel(), Engines::KotOR::GUI::getLabel(), Engines::NWN::GUI::getListBox(), Engines::KotOR::GUI::getListBox(), Engines::Jade::GUI::getListBox(), Engines::NWN::GUI::getPanel(), Engines::Jade::GUI::getPanel(), Engines::KotOR::GUI::getPanel(), Engines::KotOR::GUI::getProgressbar(), Engines::Jade::GUI::getProgressbar(), Engines::Jade::GUI::getProtoItem(), Engines::KotOR::GUI::getProtoItem(), Engines::NWN::GUI::getScrollbar(), Engines::KotOR::GUI::getScrollbar(), Engines::Jade::GUI::getScrollbar(), Engines::NWN::GUI::getSlider(), Engines::KotOR::GUI::getSlider(), Engines::Jade::GUI::getSlider(), getWidgetAt(), hasWidget(), Engines::NWN::IngameMainMenu::IngameMainMenu(), Engines::NWN::MainMenu::MainMenu(), Engines::NWN::MoviesCampMenu::MoviesCampMenu(), Engines::NWN::NewCampMenu::NewCampMenu(), Engines::NWN::NewMenu::NewMenu(), Engines::NWN::NewXP1Menu::NewXP1Menu(), Engines::NWN::NewXP2Menu::NewXP2Menu(), Engines::NWN::OptionsControlsMenu::OptionsControlsMenu(), Engines::NWN::OptionsFeedbackMenu::OptionsFeedbackMenu(), Engines::NWN::OptionsGameMenu::OptionsGameMenu(), Engines::NWN::OptionsGorePasswordMenu::OptionsGorePasswordMenu(), Engines::NWN::OptionsSoundAdvancedMenu::OptionsSoundAdvancedMenu(), Engines::NWN::OptionsSoundMenu::OptionsSoundMenu(), Engines::NWN::OptionsVideoAdvancedMenu::OptionsVideoAdvancedMenu(), Engines::NWN::OptionsVideoMenu::OptionsVideoMenu(), Engines::NWN::PartyLeader::PartyLeader(), Engines::NWN::OptionsVideoMenu::show(), Engines::NWN::MainMenu::show(), Engines::NWN::CharPremadeMenu::show(), Engines::KotOR2::QuickCharPanel::updateButtons(), and Engines::KotOR::QuickCharPanel::updateButtons().

Here is the call graph for this function:

◆ getWidget() [2/2]

const Widget * Engines::GUI::getWidget ( const Common::UString tag,
bool  vital = false 
) const
protected

Return a widget in the GUI.

Definition at line 327 of file gui.cpp.

References _widgetMap, and Common::UString::c_str().

Here is the call graph for this function:

◆ getWidgetAt()

Widget * Engines::GUI::getWidgetAt ( float  x,
float  y 
)
private

Return the widget at that position.

Definition at line 446 of file gui.cpp.

References Graphics::Renderable::getTag(), getWidget(), and GfxMan.

Referenced by mouseDown(), mouseMove(), mouseUp(), and mouseWheel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasWidget()

bool Engines::GUI::hasWidget ( const Common::UString tag) const
protected

Does this specific widget exist within the GUI?

Definition at line 310 of file gui.cpp.

References getWidget().

Referenced by Engines::Widget::addSub(), addWidget(), and Engines::NWN::CharHelp::CharHelp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hide()

void Engines::GUI::hide ( )
virtual

◆ keyDown()

void Engines::GUI::keyDown ( const Events::Event event)
private

Key down event triggered.

Definition at line 559 of file gui.cpp.

References callbackKeyInput(), and Events::kEventKeyDown.

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyUp()

void Engines::GUI::keyUp ( const Events::Event event)
private

Key up event triggeered.

Definition at line 563 of file gui.cpp.

References callbackKeyInput(), and Events::kEventKeyUp.

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseDown() [1/3]

void Engines::GUI::mouseDown ( )
protectedvirtual

Reimplemented in Engines::Jade::GUI, and Engines::KotOR::GUI.

Definition at line 440 of file gui.cpp.

Referenced by mouseDown(), and processEventQueue().

Here is the caller graph for this function:

◆ mouseDown() [2/3]

void Engines::GUI::mouseDown ( const Events::Event event)
private

Mouse down event triggered.

Definition at line 512 of file gui.cpp.

References _currentWidget, changedWidget(), getWidgetAt(), and mouseDown().

Here is the call graph for this function:

◆ mouseDown() [3/3]

void Engines::GUI::mouseDown ( Widget widget,
const Events::Event event 
)
private

Send a mouse down event to the widget.

Definition at line 584 of file gui.cpp.

References Engines::Widget::mouseDown(), toGUIX(), and toGUIY().

Here is the call graph for this function:

◆ mouseMove() [1/2]

void Engines::GUI::mouseMove ( const Events::Event event)
private

Mouse move event triggered.

Definition at line 498 of file gui.cpp.

References _currentWidget, changedWidget(), checkWidgetActive(), and getWidgetAt().

Referenced by updateMouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseMove() [2/2]

void Engines::GUI::mouseMove ( Widget widget,
const Events::Event event 
)
private

Send a mouse move event to the widget.

Definition at line 579 of file gui.cpp.

References Engines::Widget::mouseMove(), toGUIX(), and toGUIY().

Here is the call graph for this function:

◆ mouseUp() [1/3]

void Engines::GUI::mouseUp ( )
protectedvirtual

The mouse state has changed.

Reimplemented in Engines::Jade::GUI, and Engines::KotOR::GUI.

Definition at line 443 of file gui.cpp.

Referenced by mouseUp(), and processEventQueue().

Here is the caller graph for this function:

◆ mouseUp() [2/3]

void Engines::GUI::mouseUp ( const Events::Event event)
private

Mouse up event triggered.

Definition at line 525 of file gui.cpp.

References _currentWidget, changedWidget(), checkWidgetActive(), getWidgetAt(), mouseUp(), and updateMouse().

Here is the call graph for this function:

◆ mouseUp() [3/3]

void Engines::GUI::mouseUp ( Widget widget,
const Events::Event event 
)
private

◆ mouseWheel() [1/2]

void Engines::GUI::mouseWheel ( const Events::Event event)
private

Mouse wheel event triggered.

Definition at line 544 of file gui.cpp.

References _currentWidget, changedWidget(), and getWidgetAt().

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mouseWheel() [2/2]

void Engines::GUI::mouseWheel ( Widget widget,
const Events::Event event 
)
private

Send a mouse wheel event to the widget.

Definition at line 612 of file gui.cpp.

References Engines::Widget::mouseWheel().

Here is the call graph for this function:

◆ processEventQueue()

uint32 Engines::GUI::processEventQueue ( )

◆ removeChild()

void Engines::GUI::removeChild ( GUI gui)
protected

◆ removeFocus()

void Engines::GUI::removeFocus ( )
protected

Forcefully remove the focus from the current widget.

Definition at line 422 of file gui.cpp.

References changedWidget().

Referenced by Engines::NWN::PartyLeader::callbackActive(), Engines::NWN::CharFeats::callbackRun(), Engines::NWN::CharFeats::moveFeat(), processEventQueue(), run(), and sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeWidget()

void Engines::GUI::removeWidget ( Widget widget)
protected

Remove a widget.

Definition at line 267 of file gui.cpp.

References Engines::Widget::_groupMembers, Engines::Widget::_owner, Engines::Widget::_parent, _widgetMap, _widgets, Engines::Widget::getTag(), Engines::Widget::hide(), Engines::Widget::removeChild(), and Engines::Widget::removeSub().

Referenced by Engines::Widget::remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

uint32 Engines::GUI::run ( uint32  startCode = kStartCodeNone)

Run the GUI.

Definition at line 94 of file gui.cpp.

References _childGUIs, _returnCode, _startCode, addEvent(), callbackRun(), EventMan, kReturnCodeNone, processEventQueue(), removeFocus(), and updateMouse().

Referenced by Engines::KotOR2::Game::mainMenu(), Engines::Jade::Game::mainMenu(), Engines::KotOR::Game::mainMenu(), Engines::NWN::Game::mainMenu(), and sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPosition()

void Engines::GUI::setPosition ( float  x,
float  y,
float  z 
)
protected

◆ show()

void Engines::GUI::show ( )
virtual

Show the GUI.

Reimplemented in Engines::NWN::NewModuleMenu, Engines::NWN::NewPremiumMenu, Engines::NWN::CharPremadeMenu, Engines::NWN::CharInfoVoice, Engines::NWN::CharPortrait, Engines::Jade::GUI, Engines::KotOR::GUI, Engines::KotOR::DialogGUIBase, Engines::NWN::CharAttributes, Engines::NWN::CharPackage, Engines::KotOR::MenuEquipment, Engines::NWN::CharAlignment, Engines::NWN::OKCancelDialog, Engines::NWN::YesNoCancelDialog, Engines::NWN::MainMenu, Engines::NWN::OptionsResolutionMenu, Engines::NWN::OptionsSoundMenu, Engines::Jade::MainMenu, Engines::NWN::OptionsGameMenu, Engines::NWN::OptionsVideoMenu, Engines::KotOR::OptionsGameplayMenu, Engines::KotOR::OptionsGraphicsMenu, Engines::NWN::OptionsFeedbackMenu, Engines::NWN::OptionsVideoAdvancedMenu, Engines::KotOR::OptionsAutoPauseMenu, Engines::KotOR::OptionsGraphicsAdvancedMenu, Engines::KotOR::OptionsMouseSettingsMenu, and Engines::KotOR::OptionsSoundAdvancedMenu.

Definition at line 62 of file gui.cpp.

References _childGUIs, Engines::Widget::_owner, _widgets, GfxMan, and Engines::Widget::show().

Referenced by addChild(), Engines::NWN::CharTypeMenu::callbackActive(), Engines::NWN::NewMenu::callbackActive(), Engines::NWN::NewCampMenu::callbackActive(), Engines::NWN::IngameMainMenu::callbackActive(), Engines::NWN::NewXP1Menu::loadModule(), Engines::NWN::NewXP2Menu::loadModule(), Engines::NWN::NewMenu::loadModule(), Engines::NWN::OptionsFeedbackMenu::show(), Engines::NWN::OptionsVideoAdvancedMenu::show(), Engines::NWN::OptionsGameMenu::show(), Engines::NWN::OptionsVideoMenu::show(), Engines::NWN::OKCancelDialog::show(), Engines::NWN::YesNoCancelDialog::show(), Engines::NWN::OptionsSoundMenu::show(), Engines::NWN::OptionsResolutionMenu::show(), Engines::NWN::CharAlignment::show(), Engines::NWN::MainMenu::show(), Engines::NWN::CharAttributes::show(), Engines::NWN::CharPackage::show(), Engines::KotOR::GUI::show(), Engines::Jade::GUI::show(), Engines::NWN::CharPortrait::show(), Engines::NWN::CharInfoVoice::show(), Engines::NWN::CharPremadeMenu::show(), Engines::NWN::NewModuleMenu::show(), Engines::NWN::NewPremiumMenu::show(), and sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sub()

uint32 Engines::GUI::sub ( GUI gui,
uint32  startCode = kStartCodeNone,
bool  showSelf = true,
bool  hideSelf = true 
)
protected

Open up a sub GUI.

Definition at line 349 of file gui.cpp.

References _sub, getPosition(), GfxMan, hide(), removeFocus(), run(), setPosition(), show(), and updateMouse().

Referenced by Engines::KotOR::OptionsSoundMenu::callbackActive(), Engines::NWN::MoviesCampMenu::callbackActive(), Engines::KotOR2::MainMenu::callbackActive(), Engines::KotOR::OptionsGameplayMenu::callbackActive(), Engines::KotOR::OptionsGraphicsMenu::callbackActive(), Engines::NWN::NewCampMenu::callbackActive(), Engines::NWN::CharTypeMenu::callbackActive(), Engines::NWN::NewMenu::callbackActive(), Engines::NWN::OptionsMenu::callbackActive(), Engines::KotOR2::ClassSelection::callbackActive(), Engines::KotOR::MenuMap::callbackActive(), Engines::Jade::MainMenu::callbackActive(), Engines::NWN::OptionsVideoMenu::callbackActive(), Engines::NWN::CharAppearance::callbackActive(), Engines::NWN::IngameMainMenu::callbackActive(), Engines::KotOR::OptionsMenu::callbackActive(), Engines::NWN::OptionsGameMenu::callbackActive(), Engines::NWN::OptionsSoundMenu::callbackActive(), Engines::NWN::CharGenMenu::callbackActive(), Engines::KotOR::MainMenu::callbackActive(), Engines::NWN::MainMenu::callbackActive(), Engines::NWN::CharPackage::callbackActive(), Engines::KotOR::ClassSelectionMenu::callbackActive(), Engines::NWN::CharPremadeMenu::callbackActive(), Engines::Jade::OptionsMenu::callbackActive(), Engines::KotOR::ClassSelectionMenu::callbackKeyInput(), Engines::KotOR::Menu::callbackRun(), Engines::NWN::NewXP1Menu::loadModule(), Engines::NWN::NewXP2Menu::loadModule(), Engines::NWN::NewMenu::loadModule(), Engines::NWN::NewModuleMenu::loadModule(), Engines::NWN::NewPremiumMenu::loadModule(), Engines::KotOR2::CharacterGeneration::showName(), Engines::KotOR::CharacterGenerationMenu::showName(), Engines::KotOR2::CharacterGeneration::showPortrait(), and Engines::KotOR::CharacterGenerationMenu::showPortrait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textInput()

void Engines::GUI::textInput ( const Events::Event event)
private

Text input event received.

Definition at line 555 of file gui.cpp.

References callbackTextInput().

Referenced by processEventQueue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toGUIX()

float Engines::GUI::toGUIX ( int  x)
private

Definition at line 567 of file gui.cpp.

References WindowMan.

Referenced by mouseDown(), mouseMove(), and mouseUp().

Here is the caller graph for this function:

◆ toGUIY()

float Engines::GUI::toGUIY ( int  y)
private

Definition at line 573 of file gui.cpp.

References WindowMan.

Referenced by mouseDown(), mouseMove(), and mouseUp().

Here is the caller graph for this function:

◆ updateMouse()

void Engines::GUI::updateMouse ( )
protected

Force an update of the mouse position.

Definition at line 426 of file gui.cpp.

References CursorMan, and mouseMove().

Referenced by Engines::NWN::MoviesBaseMenu::callbackActive(), Engines::NWN::MoviesCampMenu::callbackActive(), mouseUp(), processEventQueue(), run(), and sub().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Widget

friend class Widget
friend

Definition at line 175 of file gui.h.

Member Data Documentation

◆ _childGUIs

std::list<GUI *> Engines::GUI::_childGUIs
private

Definition at line 138 of file gui.h.

Referenced by addChild(), hide(), removeChild(), run(), and show().

◆ _console

Console* Engines::GUI::_console
protected

Definition at line 70 of file gui.h.

Referenced by Engines::KotOR::MenuMap::callbackActive(), Engines::NWN::CharAppearance::callbackActive(), Engines::NWN::CharPackage::callbackActive(), Engines::NWN::CharPremadeMenu::CharPremadeMenu(), Engines::NWN::CharTypeMenu::CharTypeMenu(), Engines::Jade::OptionsMenu::createAudioOptions(), Engines::KotOR::MainMenu::createClassSelection(), Engines::Jade::OptionsMenu::createControlOptions(), Engines::Jade::OptionsMenu::createDifficultyOptions(), Engines::Jade::OptionsMenu::createGameInfoOptions(), Engines::KotOR::MainMenu::createLoadGame(), Engines::NWN::MainMenu::createMovies(), Engines::KotOR::MainMenu::createMovies(), Engines::NWN::MainMenu::createNew(), Engines::NWN::MainMenu::createOptions(), Engines::KotOR::MainMenu::createOptions(), Engines::Jade::OptionsMenu::createVideoOptions(), Engines::NWN::IngameMainMenu::IngameMainMenu(), Engines::NWN::CharGenMenu::init(), Engines::NWN::MainMenu::MainMenu(), Engines::NWN::MoviesCampMenu::MoviesCampMenu(), Engines::NWN::NewCampMenu::NewCampMenu(), Engines::NWN::NewMenu::NewMenu(), Engines::NWN::OptionsGameMenu::OptionsGameMenu(), Engines::KotOR::OptionsGameplayMenu::OptionsGameplayMenu(), Engines::KotOR::OptionsGraphicsMenu::OptionsGraphicsMenu(), Engines::NWN::OptionsMenu::OptionsMenu(), Engines::KotOR::OptionsMenu::OptionsMenu(), Engines::KotOR::OptionsSoundMenu::OptionsSoundMenu(), Engines::NWN::OptionsSoundMenu::OptionsSoundMenu(), Engines::NWN::OptionsVideoMenu::OptionsVideoMenu(), and processEventQueue().

◆ _currentWidget

Widget* Engines::GUI::_currentWidget
protected

The widget the mouse is currently on.

Definition at line 72 of file gui.h.

Referenced by changedWidget(), mouseDown(), mouseMove(), mouseUp(), and mouseWheel().

◆ _eventQueue

std::list<Events::Event> Engines::GUI::_eventQueue
private

The GUI event queue.

Definition at line 147 of file gui.h.

Referenced by addEvent(), and processEventQueue().

◆ _returnCode

uint32 Engines::GUI::_returnCode
protected

The GUI's return code.

Definition at line 75 of file gui.h.

Referenced by abort(), Engines::Jade::DifficultyOptionsMenu::callbackActive(), Engines::Jade::GameInfoOptionsMenu::callbackActive(), Engines::KotOR::MenuCharacter::callbackActive(), Engines::Jade::VideoOptionsMenu::callbackActive(), Engines::KotOR::MenuInventory::callbackActive(), Engines::KotOR::MenuJournal::callbackActive(), Engines::KotOR::MenuMessages::callbackActive(), Engines::Jade::AudioOptionsMenu::callbackActive(), Engines::KotOR2::CharacterGenerationPortraitMenu::callbackActive(), Engines::Jade::ControlOptionsMenu::callbackActive(), Engines::KotOR2::QuickOrCustomPanel::callbackActive(), Engines::KotOR::OptionsFeedbackMenu::callbackActive(), Engines::KotOR::OptionsKeyboardConfigurationMenu::callbackActive(), Engines::KotOR::MoviesMenu::callbackActive(), Engines::NWN::MoviesBaseMenu::callbackActive(), Engines::NWN::OptionsControlsMenu::callbackActive(), Engines::NWN::OptionsGorePasswordMenu::callbackActive(), Engines::KotOR::QuickCharPanel::callbackActive(), Engines::KotOR2::QuickCharPanel::callbackActive(), Engines::KotOR::OptionsMouseSettingsMenu::callbackActive(), Engines::KotOR::OptionsAutoPauseMenu::callbackActive(), Engines::KotOR::OptionsGraphicsAdvancedMenu::callbackActive(), Engines::KotOR::OptionsSoundMenu::callbackActive(), Engines::KotOR::OptionsSoundAdvancedMenu::callbackActive(), Engines::KotOR::QuickOrCustomPanel::callbackActive(), Engines::KotOR::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR::PartySelectionGUI::callbackActive(), Engines::NWN::MoviesCampMenu::callbackActive(), Engines::KotOR::CharacterGenerationPortraitMenu::callbackActive(), Engines::NWN::OptionsSoundAdvancedMenu::callbackActive(), Engines::NWN::NewXP2Menu::callbackActive(), Engines::KotOR2::MainMenu::callbackActive(), Engines::KotOR::ConfirmDialog::callbackActive(), Engines::KotOR2::CharacterGenerationNameMenu::callbackActive(), Engines::KotOR::OptionsGameplayMenu::callbackActive(), Engines::NWN::NewXP1Menu::callbackActive(), Engines::KotOR::OptionsGraphicsMenu::callbackActive(), Engines::KotOR::ContainerMenu::callbackActive(), Engines::NWN::CharTypeMenu::callbackActive(), Engines::NWN::NewMenu::callbackActive(), Engines::NWN::NewCampMenu::callbackActive(), Engines::NWN::OptionsFeedbackMenu::callbackActive(), Engines::NWN::CharFeatsPopup::callbackActive(), Engines::NWN::OptionsVideoAdvancedMenu::callbackActive(), Engines::NWN::CharHelp::callbackActive(), Engines::NWN::OptionsMenu::callbackActive(), Engines::NWN::OptionsVideoMenu::callbackActive(), Engines::KotOR::MenuMap::callbackActive(), Engines::KotOR2::ClassSelection::callbackActive(), Engines::Jade::MainMenu::callbackActive(), Engines::NWN::CharAppearance::callbackActive(), Engines::NWN::IngameMainMenu::callbackActive(), Engines::NWN::CharRace::callbackActive(), Engines::NWN::CharSchool::callbackActive(), Engines::NWN::CharSex::callbackActive(), Engines::NWN::CharClass::callbackActive(), Engines::NWN::OptionsGameMenu::callbackActive(), Engines::KotOR::OptionsMenu::callbackActive(), Engines::NWN::OptionsSoundMenu::callbackActive(), Engines::NWN::CharAlignment::callbackActive(), Engines::NWN::CharGenMenu::callbackActive(), Engines::NWN::CharPackage::callbackActive(), Engines::NWN::MainMenu::callbackActive(), Engines::NWN::OKCancelDialog::callbackActive(), Engines::NWN::YesNoCancelDialog::callbackActive(), Engines::KotOR::MainMenu::callbackActive(), Engines::KotOR::MenuEquipment::callbackActive(), Engines::KotOR::MenuOptions::callbackActive(), Engines::NWN::OptionsResolutionMenu::callbackActive(), Engines::KotOR::ClassSelectionMenu::callbackActive(), Engines::NWN::CharAttributes::callbackActive(), Engines::KotOR::SaveLoadMenu::callbackActive(), Engines::NWN::CharDomain::callbackActive(), Engines::NWN::CharPortrait::callbackActive(), Engines::NWN::CharInfoVoice::callbackActive(), Engines::NWN::CharFeats::callbackActive(), Engines::NWN::CharSkills::callbackActive(), Engines::NWN::CharSpells::callbackActive(), Engines::NWN::CharPremadeMenu::callbackActive(), Engines::Jade::OptionsMenu::callbackActive(), Engines::NWN::NewModuleMenu::callbackActive(), Engines::NWN::NewPremiumMenu::callbackActive(), Engines::KotOR::ClassSelectionMenu::callbackKeyInput(), Engines::KotOR::CharacterGenerationMenu::callbackKeyInput(), Engines::KotOR::Menu::callbackRun(), Engines::NWN::CharClass::hide(), Engines::NWN::CharSchool::hide(), Engines::NWN::CharRace::hide(), Engines::NWN::CharSex::hide(), Engines::NWN::CharAlignment::hide(), Engines::NWN::CharAttributes::hide(), Engines::NWN::CharSkills::hide(), Engines::NWN::NewXP2Menu::loadModule(), Engines::NWN::NewXP1Menu::loadModule(), Engines::NWN::NewMenu::loadModule(), Engines::NWN::NewModuleMenu::loadModule(), Engines::NWN::NewPremiumMenu::loadModule(), Engines::NWN::CharPremadeMenu::playCharacter(), processEventQueue(), run(), Engines::KotOR2::CharacterGeneration::start(), and Engines::KotOR::SaveLoadMenu::tryLoadGame().

◆ _startCode

uint32 Engines::GUI::_startCode
protected

The GUI's start code.

Definition at line 74 of file gui.h.

Referenced by callbackRun(), and run().

◆ _sub

GUI* Engines::GUI::_sub
protected

The currently running sub GUI.

Definition at line 77 of file gui.h.

Referenced by abort(), and sub().

◆ _widgetMap

WidgetMap Engines::GUI::_widgetMap
private

All widgets in the GUI, index by their tag.

Definition at line 141 of file gui.h.

Referenced by addWidget(), clearWidgets(), getWidget(), and removeWidget().

◆ _widgets

WidgetList Engines::GUI::_widgets
private

All widgets in the GUI.

Definition at line 140 of file gui.h.

Referenced by addWidget(), clearWidgets(), empty(), hide(), removeWidget(), setPosition(), show(), and ~GUI().

◆ _x

float Engines::GUI::_x
private

The GUI X position.

Definition at line 143 of file gui.h.

Referenced by getPosition(), and setPosition().

◆ _y

float Engines::GUI::_y
private

The GUI Y position.

Definition at line 144 of file gui.h.

Referenced by getPosition(), and setPosition().

◆ _z

float Engines::GUI::_z
private

The GUI Z position.

Definition at line 145 of file gui.h.

Referenced by getPosition(), and setPosition().

◆ kReturnCodeAbort

const uint32 Engines::GUI::kReturnCodeAbort = 0xFFFFFFFF
static

◆ kReturnCodeNone

const uint32 Engines::GUI::kReturnCodeNone = 0
static

Definition at line 46 of file gui.h.

Referenced by processEventQueue(), and run().

◆ kStartCodeNone

const uint32 Engines::GUI::kStartCodeNone = 0
static

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