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

A KotOR GUI. More...

#include <gui.h>

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

Classes

struct  WidgetContext
 

Public Member Functions

 GUI (::Engines::Console *console=0)
 
 ~GUI ()
 
virtual void show ()
 Show the GUI. More...
 
virtual void hide ()
 Hide the GUI. More...
 
void convertToXoreos (float &x, float &y, const float widgetHeight) const
 Converts Kotor' GUI coordinates with a coordinate origin in the upper left corner to the Xoreos coordinate system with the coordinate origin in the center. More...
 
void convertToGUI (float &x, float &y, const float widgetHeight) const
 Converts Xoreos' coordinates with a coordinate origin in the center to Kotor's GUI coordinates with the coordinate origin in the the upper left corner. More...
 
Common::UString getName () const
 
- Public Member Functions inherited from Engines::GUI
 GUI (Console *console=0)
 
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...
 

Protected Types

enum  WidgetType {
  kWidgetTypeInvalid = - 1, kWidgetTypePanel = 2, kWidgetTypeLabel = 4, kWidgetTypeProtoItem = 5,
  kWidgetTypeButton = 6, kWidgetTypeCheckBox = 7, kWidgetTypeSlider = 8, kWidgetTypeScrollbar = 9,
  kWidgetTypeProgressbar = 10, kWidgetTypeListBox = 11
}
 

Protected Member Functions

virtual void mouseUp ()
 The mouse state has changed. More...
 
virtual void mouseDown ()
 
void load (const Common::UString &resref)
 
virtual void initWidget (Widget &widget)
 
WidgetPanelgetPanel (const Common::UString &tag, bool vital=false)
 
WidgetLabelgetLabel (const Common::UString &tag, bool vital=false)
 
WidgetProtoItemgetProtoItem (const Common::UString &tag, bool vital=false)
 
WidgetButtongetButton (const Common::UString &tag, bool vital=false)
 
WidgetCheckBoxgetCheckBox (const Common::UString &tag, bool vital=false)
 
WidgetSlidergetSlider (const Common::UString &tag, bool vital=false)
 
WidgetScrollbargetScrollbar (const Common::UString &tag, bool vital=false)
 
WidgetProgressbargetProgressbar (const Common::UString &tag, bool vital=false)
 
WidgetListBoxgetListBox (const Common::UString &tag, bool vital=false)
 
void addBackground (const Common::UString &background, bool front=false)
 
void setCheckBoxState (const Common::UString &tag, bool state)
 
bool getCheckBoxState (const Common::UString &tag)
 
- Protected Member Functions inherited from Engines::GUI
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...
 
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...
 

Private Member Functions

void loadWidget (const Aurora::GFF3Struct &strct, Widget *parent)
 
void createWidget (WidgetContext &ctx)
 

Private Attributes

float _widgetZ
 
float _guiHeight
 
float _guiWidth
 
Common::ScopedPtr< GUIBackground_background
 
Common::ScopedPtr< Aurora::GFF3File_gff
 
Common::UString _name
 

Additional Inherited Members

- Static Public Attributes inherited from Engines::GUI
static const uint32 kStartCodeNone = 0
 
static const uint32 kReturnCodeNone = 0
 
static const uint32 kReturnCodeAbort = 0xFFFFFFFF
 
- Protected Attributes inherited from Engines::GUI
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...
 

Detailed Description

A KotOR GUI.

Definition at line 57 of file gui.h.

Member Enumeration Documentation

◆ WidgetType

Enumerator
kWidgetTypeInvalid 
kWidgetTypePanel 
kWidgetTypeLabel 
kWidgetTypeProtoItem 
kWidgetTypeButton 
kWidgetTypeCheckBox 
kWidgetTypeSlider 
kWidgetTypeScrollbar 
kWidgetTypeProgressbar 
kWidgetTypeListBox 

Definition at line 81 of file gui.h.

Constructor & Destructor Documentation

◆ GUI()

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

Definition at line 63 of file gui.cpp.

◆ ~GUI()

Engines::KotOR::GUI::~GUI ( )
virtual

Reimplemented from Engines::GUI.

Definition at line 66 of file gui.cpp.

Member Function Documentation

◆ addBackground()

void Engines::KotOR::GUI::addBackground ( const Common::UString background,
bool  front = false 
)
protected

◆ convertToGUI()

void Engines::KotOR::GUI::convertToGUI ( float &  x,
float &  y,
const float  widgetHeight 
) const

Converts Xoreos' coordinates with a coordinate origin in the center to Kotor's GUI coordinates with the coordinate origin in the the upper left corner.

Definition at line 86 of file gui.cpp.

References _guiHeight, and _guiWidth.

◆ convertToXoreos()

void Engines::KotOR::GUI::convertToXoreos ( float &  x,
float &  y,
const float  widgetHeight 
) const

Converts Kotor' GUI coordinates with a coordinate origin in the upper left corner to the Xoreos coordinate system with the coordinate origin in the center.

Definition at line 81 of file gui.cpp.

References _guiHeight, and _guiWidth.

Referenced by loadWidget().

Here is the caller graph for this function:

◆ createWidget()

void Engines::KotOR::GUI::createWidget ( WidgetContext ctx)
private

◆ getButton()

WidgetButton * Engines::KotOR::GUI::getButton ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getCheckBox()

WidgetCheckBox * Engines::KotOR::GUI::getCheckBox ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getCheckBoxState()

bool Engines::KotOR::GUI::getCheckBoxState ( const Common::UString tag)
protected

◆ getLabel()

WidgetLabel * Engines::KotOR::GUI::getLabel ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 204 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Referenced by Engines::KotOR2::CharacterGenerationPortraitMenu::callbackActive(), Engines::KotOR::CharacterGenerationPortraitMenu::callbackActive(), Engines::KotOR::MenuEquipment::callbackRun(), Engines::KotOR2::CharacterGeneration::CharacterGeneration(), Engines::KotOR::CharacterGenerationMenu::CharacterGenerationMenu(), Engines::KotOR2::ClassSelection::ClassSelection(), Engines::KotOR::ClassSelectionMenu::ClassSelectionMenu(), Engines::KotOR::CustomCharPanel::CustomCharPanel(), Engines::KotOR::MenuEquipment::fillEquipedItems(), Engines::KotOR::ContainerMenu::fillFromInventory(), Engines::KotOR::MenuEquipment::fixateOnSlot(), Engines::KotOR::LoadScreen::LoadScreen(), Engines::KotOR::MainMenu::MainMenu(), Engines::KotOR::MenuEquipment::MenuEquipment(), Engines::KotOR::PartySelectionGUI::onSelectionChanged(), Engines::KotOR::QuickCharPanel::QuickCharPanel(), Engines::KotOR::QuickOrCustomPanel::QuickOrCustomPanel(), Engines::KotOR::DialogGUIBase::refresh(), Engines::KotOR::SaveLoadMenu::SaveLoadMenu(), Engines::KotOR::ClassSelectionMenu::setupClassSubScene(), Engines::KotOR2::CharacterGeneration::showName(), Engines::KotOR::CharacterGenerationMenu::showName(), Engines::KotOR2::CharacterGeneration::showPortrait(), Engines::KotOR::CharacterGenerationMenu::showPortrait(), Engines::KotOR::PartySelectionGUI::toggleSlot(), and Engines::KotOR::DialogGUIBase::update().

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

◆ getListBox()

WidgetListBox * Engines::KotOR::GUI::getListBox ( const Common::UString tag,
bool  vital = false 
)
protected

◆ getName()

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

Reimplemented from Engines::GUI.

Definition at line 91 of file gui.cpp.

References _name.

◆ getPanel()

WidgetPanel * Engines::KotOR::GUI::getPanel ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 192 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Referenced by Engines::KotOR::ConfirmDialog::ConfirmDialog(), Engines::KotOR::ContainerMenu::ContainerMenu(), and Engines::KotOR::LoadScreen::LoadScreen().

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

◆ getProgressbar()

WidgetProgressbar * Engines::KotOR::GUI::getProgressbar ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 276 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Referenced by Engines::KotOR::LoadScreen::LoadScreen().

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

◆ getProtoItem()

WidgetProtoItem * Engines::KotOR::GUI::getProtoItem ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 216 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Referenced by Engines::KotOR::Menu::Menu().

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

◆ getScrollbar()

WidgetScrollbar * Engines::KotOR::GUI::getScrollbar ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 264 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Here is the call graph for this function:

◆ getSlider()

WidgetSlider * Engines::KotOR::GUI::getSlider ( const Common::UString tag,
bool  vital = false 
)
protected

Definition at line 252 of file gui.cpp.

References Common::UString::c_str(), and Engines::GUI::getWidget().

Here is the call graph for this function:

◆ hide()

void Engines::KotOR::GUI::hide ( )
virtual

◆ initWidget()

void Engines::KotOR::GUI::initWidget ( Widget widget)
protectedvirtual

Reimplemented in Engines::KotOR::HUD, Engines::KotOR::MainMenu, Engines::KotOR2::MainMenu, Engines::KotOR2::GUI, and Engines::KotOR2::HUD.

Definition at line 189 of file gui.cpp.

Referenced by createWidget().

Here is the caller graph for this function:

◆ load()

void Engines::KotOR::GUI::load ( const Common::UString resref)
protected

Definition at line 103 of file gui.cpp.

References _gff, _guiHeight, _guiWidth, _name, Common::StackException::add(), Common::UString::c_str(), Engines::GUI::clearWidgets(), Engines::GUI::empty(), Aurora::kFileTypeGUI, loadWidget(), MKTAG, Common::ScopedPtrBase< T, Deallocator >::reset(), and ResMan.

Referenced by Engines::KotOR2::CharacterGeneration::CharacterGeneration(), Engines::KotOR::CharacterGenerationMenu::CharacterGenerationMenu(), Engines::KotOR2::ClassSelection::ClassSelection(), Engines::KotOR::ClassSelectionMenu::ClassSelectionMenu(), Engines::KotOR::ConfirmDialog::ConfirmDialog(), Engines::KotOR::ContainerMenu::ContainerMenu(), Engines::KotOR2::CustomCharPanel::CustomCharPanel(), Engines::KotOR::CustomCharPanel::CustomCharPanel(), Engines::KotOR::DialogGUIBase::DialogGUIBase(), Engines::KotOR2::HUD::HUD(), Engines::KotOR::LoadScreen::LoadScreen(), Engines::KotOR2::MainMenu::MainMenu(), Engines::KotOR::MainMenu::MainMenu(), Engines::KotOR::Menu::Menu(), Engines::KotOR::MenuAbilities::MenuAbilities(), Engines::KotOR::MenuCharacter::MenuCharacter(), Engines::KotOR::MenuEquipment::MenuEquipment(), Engines::KotOR::MenuInventory::MenuInventory(), Engines::KotOR::MenuJournal::MenuJournal(), Engines::KotOR::MenuMap::MenuMap(), Engines::KotOR::MenuMessages::MenuMessages(), Engines::KotOR::MenuOptions::MenuOptions(), Engines::KotOR::MoviesMenu::MoviesMenu(), Engines::KotOR::OptionsAutoPauseMenu::OptionsAutoPauseMenu(), Engines::KotOR::OptionsFeedbackMenu::OptionsFeedbackMenu(), Engines::KotOR::OptionsGameplayMenu::OptionsGameplayMenu(), Engines::KotOR::OptionsGraphicsAdvancedMenu::OptionsGraphicsAdvancedMenu(), Engines::KotOR::OptionsGraphicsMenu::OptionsGraphicsMenu(), Engines::KotOR::OptionsKeyboardConfigurationMenu::OptionsKeyboardConfigurationMenu(), Engines::KotOR::OptionsMenu::OptionsMenu(), Engines::KotOR::OptionsMouseSettingsMenu::OptionsMouseSettingsMenu(), Engines::KotOR::OptionsSoundAdvancedMenu::OptionsSoundAdvancedMenu(), Engines::KotOR::OptionsSoundMenu::OptionsSoundMenu(), Engines::KotOR::PartySelectionGUI::PartySelectionGUI(), Engines::KotOR2::QuickCharPanel::QuickCharPanel(), Engines::KotOR::QuickCharPanel::QuickCharPanel(), Engines::KotOR2::QuickOrCustomPanel::QuickOrCustomPanel(), Engines::KotOR::QuickOrCustomPanel::QuickOrCustomPanel(), and Engines::KotOR::SaveLoadMenu::SaveLoadMenu().

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

◆ loadWidget()

void Engines::KotOR::GUI::loadWidget ( const Aurora::GFF3Struct strct,
Widget parent 
)
private

◆ mouseDown()

void Engines::KotOR::GUI::mouseDown ( )
protectedvirtual

Reimplemented from Engines::GUI.

Definition at line 95 of file gui.cpp.

References CursorMan.

◆ mouseUp()

void Engines::KotOR::GUI::mouseUp ( )
protectedvirtual

The mouse state has changed.

Reimplemented from Engines::GUI.

Definition at line 99 of file gui.cpp.

References CursorMan.

◆ setCheckBoxState()

void Engines::KotOR::GUI::setCheckBoxState ( const Common::UString tag,
bool  state 
)
protected

◆ show()

void Engines::KotOR::GUI::show ( )
virtual

Member Data Documentation

◆ _background

Common::ScopedPtr<GUIBackground> Engines::KotOR::GUI::_background
private

Definition at line 135 of file gui.h.

Referenced by addBackground(), hide(), and show().

◆ _gff

Common::ScopedPtr<Aurora::GFF3File> Engines::KotOR::GUI::_gff
private

Definition at line 137 of file gui.h.

Referenced by load().

◆ _guiHeight

float Engines::KotOR::GUI::_guiHeight
private

Definition at line 132 of file gui.h.

Referenced by convertToGUI(), convertToXoreos(), load(), and loadWidget().

◆ _guiWidth

float Engines::KotOR::GUI::_guiWidth
private

Definition at line 133 of file gui.h.

Referenced by convertToGUI(), convertToXoreos(), load(), and loadWidget().

◆ _name

Common::UString Engines::KotOR::GUI::_name
private

Definition at line 139 of file gui.h.

Referenced by getName(), and load().

◆ _widgetZ

float Engines::KotOR::GUI::_widgetZ
private

Definition at line 130 of file gui.h.

Referenced by loadWidget().


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