Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sw::gui::HostLogic Class Reference

Logic of host window for managing child controls. More...

#include <HostLogic.h>

Public Member Functions

 HostLogic (HostWindow *hostWindow)
 
 ~HostLogic ()=default
 
void RemoveControl (UIElement *control)
 
void RegisterControlName (UIElement *control, const std::string &name)
 
const std::string & GetControlName (UIElement *control)
 
Size GetMemorySize ()
 
GUI system interaction
void LostFocus ()
 
void GotFocus ()
 
void OnResized (uint16 newWidth, uint16 newHeight)
 
void OnMaximized ()
 
void OnMinimized ()
 
Input handling
void HandleKeyInput (const input::DeviceEvent &event, input::Device *device)
 
void HandleCharInput (const input::DeviceEvent &event, input::Device *device)
 
void HandleMouseButtonInput (const input::DeviceEvent &event, input::Device *device)
 
void HandleMouseWheelInput (const input::DeviceEvent &event, input::Device *device)
 
void HandleMouseMoveInput (const input::DeviceEvent &event, input::Device *device)
 

Private Member Functions

UIElementHitTesting ()
 

Private Attributes

std::vector< UIElement * > m_controlsTree
 Top level controls. This vector holds entire tree. More...
 
std::vector< UIElement * > m_mousePath
 Controls hierarchy that have mouse over in this frame. More...
 
std::vector< UIElement * > m_keyboardFocus
 Path of controls that have keyboard focus and all events are directed to them. More...
 
UIElementm_mouseCapture
 Element that captured mouse. Can be nullptr. More...
 
std::vector< UIElement * > m_invalidated
 Controls which needs to be redrawn in this frame. More...
 
Controls info
std::map< UIElement *, std::string > m_controlsNames
 

Friends

class HostLogicTester
 

Detailed Description

Logic of host window for managing child controls.

Constructor & Destructor Documentation

sw::gui::HostLogic::HostLogic ( HostWindow hostWindow)
explicit
sw::gui::HostLogic::~HostLogic ( )
default

Member Function Documentation

const std::string & sw::gui::HostLogic::GetControlName ( UIElement control)
Size sw::gui::HostLogic::GetMemorySize ( )
void sw::gui::HostLogic::GotFocus ( )
void sw::gui::HostLogic::HandleCharInput ( const input::DeviceEvent event,
input::Device device 
)
void sw::gui::HostLogic::HandleKeyInput ( const input::DeviceEvent event,
input::Device device 
)
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
void sw::gui::HostLogic::HandleMouseButtonInput ( const input::DeviceEvent event,
input::Device device 
)
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
Todo:
Handle failing during event raising.
void sw::gui::HostLogic::HandleMouseMoveInput ( const input::DeviceEvent event,
input::Device device 
)
void sw::gui::HostLogic::HandleMouseWheelInput ( const input::DeviceEvent event,
input::Device device 
)
UIElement* sw::gui::HostLogic::HitTesting ( )
private
void sw::gui::HostLogic::LostFocus ( )
void sw::gui::HostLogic::OnMaximized ( )
void sw::gui::HostLogic::OnMinimized ( )
void sw::gui::HostLogic::OnResized ( uint16  newWidth,
uint16  newHeight 
)
void sw::gui::HostLogic::RegisterControlName ( UIElement control,
const std::string &  name 
)
void sw::gui::HostLogic::RemoveControl ( UIElement control)

Friends And Related Function Documentation

friend class HostLogicTester
friend

Member Data Documentation

std::map< UIElement*, std::string > sw::gui::HostLogic::m_controlsNames
private

Map containing windows names. Most controls don't have name, so it's better to store them separatly, to lower memory consumption.

std::vector< UIElement* > sw::gui::HostLogic::m_controlsTree
private

Top level controls. This vector holds entire tree.

std::vector< UIElement* > sw::gui::HostLogic::m_invalidated
private

Controls which needs to be redrawn in this frame.

Todo:
Move to different logic. Separate rearrangement and redraw.
std::vector< UIElement* > sw::gui::HostLogic::m_keyboardFocus
private

Path of controls that have keyboard focus and all events are directed to them.

UIElement* sw::gui::HostLogic::m_mouseCapture
private

Element that captured mouse. Can be nullptr.

std::vector< UIElement* > sw::gui::HostLogic::m_mousePath
private

Controls hierarchy that have mouse over in this frame.


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