PixelLightAPI  .
Public Member Functions
PLGui::Gui Class Reference

Main GUI class. More...

#include <Gui.h>

Inheritance diagram for PLGui::Gui:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLGUI_API Gui (const PLCore::String &sGui="")
 Get system GUI.
virtual PLGUI_API ~Gui ()
 Destructor.
PLGUI_API GuiImpl * GetImpl () const
 Get implementation.
PLGUI_API void Shutdown ()
 Shut down GUI and clean up.
PLGUI_API bool IsActive () const
 Check if the GUI is still active.
PLGUI_API void Exit ()
 Exit application.
PLGUI_API bool HasPendingMessages () const
 Check if there are system messages waiting.
PLGUI_API void ProcessMessages ()
 Process all waiting messages, blocks if no messages are waiting.
PLGUI_API void PostMessage (const GuiMessage &cMessage)
 Post message to the message queue.
PLGUI_API void SendMessage (const GuiMessage &cMessage)
 Send and process a message directly.
PLGUI_API void WakeUp ()
 Wakeup message loop.
PLGUI_API const
PLCore::Container
< MessageFilter * > & 
GetMessageFilters () const
 Get message filters.
PLGUI_API void AddMessageFilter (MessageFilter *pFilter)
 Add message filter.
PLGUI_API void RemoveMessageFilter (MessageFilter *pFilter)
 Remove and destroy message filter.
PLGUI_API WidgetGetRootWidget () const
 Returns the root widget.
PLGUI_API const
PLCore::Container< Screen * > & 
GetScreens () const
 Get list of screens (monitors)
PLGUI_API ScreenGetScreen (const PLCore::String &sName) const
 Get screen by name.
PLGUI_API ScreenGetDefaultScreen () const
 Get default screen.
PLGUI_API FontManagerGetFontManager ()
 Get font manager.
PLGUI_API CursorManagerGetCursorManager ()
 Get cursor manager.
PLGUI_API ClipBoardGetClipBoard ()
 Get clipboard.
PLGUI_API bool HasTaskbar () const
 Check if the GUI has a taskbar.
PLGUI_API bool IsMouseVisible () const
 Check if the mouse cursor is visible.
PLGUI_API void SetMouseVisible (bool bVisible)
 Set mouse cursor visibility.
PLGUI_API WidgetGetMouseOverWidget () const
 Get widget that the mouse is currently in.
PLGUI_API WidgetGetFocusWidget () const
 Get widget that currently has the focus.
PLGUI_API void ShowTooltip (const PLMath::Vector2i &vPos, const PLCore::String &sTooltip)
 Display a tooltip.
PLGUI_API ThemeGetTheme () const
 Get theme.
PLGUI_API void SetTheme (Theme *pTheme)
 Set theme.
PLGUI_API void SetTheme (const PLCore::String &sClass, const PLCore::String &sOptions)
 Set theme.
PLGUI_API PLCore::uint64 GetHoverTime () const
 Get time after which a hove event occurs.
PLGUI_API void SetHoverTime (PLCore::uint64 nTimeout)
 Set time after which a hove event occurs.

Detailed Description

Main GUI class.

Remarks:
This class provides the main functions of a GUI system (desktop, widgets, ...)
Note:
  • Implementation of the bridge design pattern, this class is the abstraction

Constructor & Destructor Documentation

PLGUI_API PLGui::Gui::Gui ( const PLCore::String sGui = "")

Get system GUI.

Returns:
Pointer to system GUI

Constructor

Parameters:
[in]sGuiName of the GUI backend that shall be used. Just leave this empty for the system GUI
Remarks:
To obtain a pointer to the system GUI, use GetSystemGui() instead of creating a new instance
virtual PLGUI_API PLGui::Gui::~Gui ( ) [virtual]

Destructor.


Member Function Documentation

PLGUI_API GuiImpl* PLGui::Gui::GetImpl ( ) const

Get implementation.

Returns:
Pointer to platform specific implementation
PLGUI_API void PLGui::Gui::Shutdown ( )

Shut down GUI and clean up.

Remarks:
Call this for the system GUI at the end of your application, otherwise there might be trouble with the static deinitialization order!
PLGUI_API bool PLGui::Gui::IsActive ( ) const

Check if the GUI is still active.

Returns:
'true', if the GUI is active, 'false' if the program shall quit
PLGUI_API void PLGui::Gui::Exit ( )

Exit application.

PLGUI_API bool PLGui::Gui::HasPendingMessages ( ) const

Check if there are system messages waiting.

Returns:
'true' if there are messages in the queue
PLGUI_API void PLGui::Gui::ProcessMessages ( )

Process all waiting messages, blocks if no messages are waiting.

PLGUI_API void PLGui::Gui::PostMessage ( const GuiMessage cMessage)

Post message to the message queue.

Parameters:
[in]cMessageMessage to be posted
Remarks:
This function adds the given message to the message queue, so that it will be processed with subsequent call(s) to ProcessMessages(). To send a message directly (bypassing the message queue), see SendMessage().
PLGUI_API void PLGui::Gui::SendMessage ( const GuiMessage cMessage)

Send and process a message directly.

Parameters:
[in]cMessageMessage to be sent
Remarks:
This function sends a message directly to the GUI. Use this only if you know exactly, what you are doing, because this bypasses the message queue. Usually it is the right way to post a message to the queue for it to get processed in the right order (after calling ProcessMessages()).
PLGUI_API void PLGui::Gui::WakeUp ( )

Wakeup message loop.

Remarks:
This function posts a wakeup-message to the message loop, so that it wakes up

Get message filters.

Returns:
List of message filters
PLGUI_API void PLGui::Gui::AddMessageFilter ( MessageFilter pFilter)

Add message filter.

Parameters:
[in]pFilterMessage filter, will be destroyed by Gui automatically
PLGUI_API void PLGui::Gui::RemoveMessageFilter ( MessageFilter pFilter)

Remove and destroy message filter.

Parameters:
[in]pFilterMessage filter
PLGUI_API Widget* PLGui::Gui::GetRootWidget ( ) const

Returns the root widget.

Returns:
Root widget, a null pointer on error
PLGUI_API const PLCore::Container<Screen*>& PLGui::Gui::GetScreens ( ) const

Get list of screens (monitors)

Returns:
List of screens
PLGUI_API Screen* PLGui::Gui::GetScreen ( const PLCore::String sName) const

Get screen by name.

Parameters:
[in]sNameName of screen
Returns:
Pointer to the specific screen, or a null pointer if that screen doesn't exist
PLGUI_API Screen* PLGui::Gui::GetDefaultScreen ( ) const

Get default screen.

Returns:
Pointer to the default screen, never a null pointer

Get font manager.

Returns:
Font manager

Get cursor manager.

Returns:
Cursor manager

Get clipboard.

Returns:
Clipboard
PLGUI_API bool PLGui::Gui::HasTaskbar ( ) const

Check if the GUI has a taskbar.

Returns:
'true', if the GUI has a taskbar, else 'false'
PLGUI_API bool PLGui::Gui::IsMouseVisible ( ) const

Check if the mouse cursor is visible.

Returns:
'true' if the mouse cursor is visible, else 'false'
Note:
  • If the mouse cursor is visible in general, it's still possible that it's invisible over some special widgets.
  • If the mouse cursor is invisible in general, it will NEVER be visible!
PLGUI_API void PLGui::Gui::SetMouseVisible ( bool  bVisible)

Set mouse cursor visibility.

Parameters:
[in]bVisibleShall the mouse cursor be visible?
See also:
PLGUI_API Widget* PLGui::Gui::GetMouseOverWidget ( ) const

Get widget that the mouse is currently in.

Returns:
Widget the mouse is currently in, or a null pointer
PLGUI_API Widget* PLGui::Gui::GetFocusWidget ( ) const

Get widget that currently has the focus.

Returns:
Widget that currently has the focus, or a null pointer
PLGUI_API void PLGui::Gui::ShowTooltip ( const PLMath::Vector2i vPos,
const PLCore::String sTooltip 
)

Display a tooltip.

Parameters:
[in]vPosPosition of tooltip
[in]sTooltipTooltip text
PLGUI_API Theme* PLGui::Gui::GetTheme ( ) const

Get theme.

Returns:
Pointer to current theme
PLGUI_API void PLGui::Gui::SetTheme ( Theme pTheme)

Set theme.

Parameters:
[in]pThemeTheme
PLGUI_API void PLGui::Gui::SetTheme ( const PLCore::String sClass,
const PLCore::String sOptions 
)

Set theme.

Parameters:
[in]sClassTheme class
[in]sOptionsTheme options
PLGUI_API PLCore::uint64 PLGui::Gui::GetHoverTime ( ) const

Get time after which a hove event occurs.

Returns:
Timeout (in milliseconds)
PLGUI_API void PLGui::Gui::SetHoverTime ( PLCore::uint64  nTimeout)

Set time after which a hove event occurs.

Parameters:
[in]nTimeoutTimeout (in milliseconds)
Remarks:
If set to 0, hover events will be disabled completely.

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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:18
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported