PixelLightAPI
.
|
Abstract frontend base class. More...
#include <Frontend.h>
Public Member Functions | |
PLCORE_API | Frontend (const FrontendContext &cFrontendContext, FrontendImpl &cFrontendImpl) |
Run the frontend. | |
virtual PLCORE_API | ~Frontend () |
Destructor. | |
const FrontendContext & | GetContext () const |
Get frontend context. | |
FrontendImpl * | GetImpl () const |
Get frontend implementation. | |
handle | GetNativeWindowHandle () const |
Get native window handle. | |
void | Redraw () |
Redraw frontend. | |
void | Ping () const |
Give the frontend a chance to process OS messages. | |
void | RedrawAndPing () |
Redraw frontend and give the frontend a chance to process OS messages. | |
String | GetTitle () const |
Get frontend title. | |
void | SetTitle (const String &sTitle) |
Set frontend title. | |
int | GetX () const |
Get the x position of the frontend (in screen coordinates) | |
int | GetY () const |
Get the y position of the frontend (in screen coordinates) | |
uint32 | GetWidth () const |
Get frontend width. | |
uint32 | GetHeight () const |
Get frontend height. | |
void | GetWindowPositionSize (int &nX, int &nY, uint32 &nWidth, uint32 &nHeight) const |
Returns frontend window position and size. | |
void | SetWindowPositionSize (int nX, int nY, uint32 nWidth, uint32 nHeight) |
Set frontend window position and size. | |
bool | GetToggleFullscreenMode () const |
Gets whether it's allowed to toggle the fullscreen mode using hotkeys. | |
void | SetToggleFullscreenMode (bool bToggleFullscreenMode) |
Sets whether it's allowed to toggle the fullscreen mode using hotkeys. | |
bool | GetFullscreenAltTab () const |
Gets whether it's allowed to use Alt-Tab if fullscreen mode is used. | |
void | SetFullscreenAltTab (bool bAllowed) |
Sets whether it's allowed to use Alt-Tab if fullscreen mode is used. | |
bool | IsFullscreen () const |
Returns whether the frontend is in fullscreen mode or not. | |
void | SetFullscreen (bool bFullscreen) |
Sets the frontend's fullscreen mode. | |
void | RefreshFullscreen () |
Something related to fullscreen mode has been changed (e.g. the display resolution) | |
bool | IsMouseOver () const |
Check if the mouse is currently over the frontend. | |
int | GetMousePositionX () const |
Get current mouse cursor X position inside the frontend. | |
int | GetMousePositionY () const |
Get current mouse cursor Y position inside the frontend. | |
bool | IsMouseVisible () const |
Check if the mouse cursor is visible. | |
void | SetMouseVisible (bool bVisible) |
Set mouse cursor visibility. | |
void | SetTrapMouse (bool bTrap) |
Trap mouse inside the frontend. | |
virtual bool | IsRunning () const =0 |
Returns whether or not the frontend is currently running. | |
Protected Member Functions | |
virtual PLCORE_API void | OnRun (const String &sExecutableFilename, const Array< String > &lstArguments) |
Called when the frontend is run. | |
Protected Attributes | |
const FrontendContext & | m_cFrontendContext |
FrontendImpl * | m_pFrontendImpl |
Abstract frontend base class.
The focus of this class is on applications with just one window (if there's a window at all, this depends on the used frontend implementation). This focus makes application development somewhat easier because you only have to concentrate our realizing your project and not how it will be presented (in a window with border, without border, just rendering into an image etc.) to the user.
The PixelLight technology is designed to be as flexible as possible and so, although this class has a clear focus, it can also be used to develop multi-window applications as well.
Please note that the frontend system is not designed to be a replacement for a decent GUI system. In here, only primitive and commonly used GUI related feature are offered with a limited feature set. For more complex stuff one has to use a real GUI system.
PLCORE_API PLCore::Frontend::Frontend | ( | const FrontendContext & | cFrontendContext, |
FrontendImpl & | cFrontendImpl | ||
) |
Run the frontend.
[in] | cFrontendContext | Frontend context to use (just shared, the given instance must stay valid as long as this frontend lives) |
[in] | bUrgentMessageAllowed | Is this method allowed to show an urgent message to the user in case of a failure? |
virtual PLCORE_API PLCore::Frontend::~Frontend | ( | ) | [virtual] |
Destructor.
const FrontendContext & PLCore::Frontend::GetContext | ( | ) | const [inline] |
Get frontend context.
FrontendImpl * PLCore::Frontend::GetImpl | ( | ) | const [inline] |
Get frontend implementation.
handle PLCore::Frontend::GetNativeWindowHandle | ( | ) | const [inline] |
Get native window handle.
void PLCore::Frontend::Redraw | ( | ) | [inline] |
Redraw frontend.
void PLCore::Frontend::Ping | ( | ) | const [inline] |
Give the frontend a chance to process OS messages.
void PLCore::Frontend::RedrawAndPing | ( | ) | [inline] |
Redraw frontend and give the frontend a chance to process OS messages.
String PLCore::Frontend::GetTitle | ( | ) | const [inline] |
Get frontend title.
void PLCore::Frontend::SetTitle | ( | const String & | sTitle | ) | [inline] |
int PLCore::Frontend::GetX | ( | ) | const [inline] |
Get the x position of the frontend (in screen coordinates)
int PLCore::Frontend::GetY | ( | ) | const [inline] |
Get the y position of the frontend (in screen coordinates)
uint32 PLCore::Frontend::GetWidth | ( | ) | const [inline] |
Get frontend width.
uint32 PLCore::Frontend::GetHeight | ( | ) | const [inline] |
Get frontend height.
void PLCore::Frontend::GetWindowPositionSize | ( | int & | nX, |
int & | nY, | ||
uint32 & | nWidth, | ||
uint32 & | nHeight | ||
) | const [inline] |
Returns frontend window position and size.
[out] | nX | Receives the x position of the frontend window (in screen coordinates) |
[out] | nY | Receives the y position of the frontend window (in screen coordinates) |
[out] | nWidth | Receives the width of the frontend window |
[out] | nHeight | Receives the height of the frontend window |
void PLCore::Frontend::SetWindowPositionSize | ( | int | nX, |
int | nY, | ||
uint32 | nWidth, | ||
uint32 | nHeight | ||
) | [inline] |
Set frontend window position and size.
[in] | nX | X position of the frontend window (in screen coordinates) |
[in] | nY | Y position of the frontend window (in screen coordinates) |
[in] | nWidth | Width of the frontend window |
[in] | nHeight | Height of the frontend window |
bool PLCore::Frontend::GetToggleFullscreenMode | ( | ) | const [inline] |
Gets whether it's allowed to toggle the fullscreen mode using hotkeys.
void PLCore::Frontend::SetToggleFullscreenMode | ( | bool | bToggleFullscreenMode | ) | [inline] |
Sets whether it's allowed to toggle the fullscreen mode using hotkeys.
[in] | bToggleFullscreenMode | Is it allowed to toggle the fullscreen mode using hotkeys? |
bool PLCore::Frontend::GetFullscreenAltTab | ( | ) | const [inline] |
Gets whether it's allowed to use Alt-Tab if fullscreen mode is used.
void PLCore::Frontend::SetFullscreenAltTab | ( | bool | bAllowed | ) | [inline] |
Sets whether it's allowed to use Alt-Tab if fullscreen mode is used.
[in] | bAllowed | Is it allowed to use Alt-Tab within fullscreen mode? |
bool PLCore::Frontend::IsFullscreen | ( | ) | const [inline] |
Returns whether the frontend is in fullscreen mode or not.
void PLCore::Frontend::SetFullscreen | ( | bool | bFullscreen | ) | [inline] |
Sets the frontend's fullscreen mode.
[in] | bFullscreen | 'true' if the frontend should be in fullscreen mode, else 'false' |
void PLCore::Frontend::RefreshFullscreen | ( | ) | [inline] |
Something related to fullscreen mode has been changed (e.g. the display resolution)
bool PLCore::Frontend::IsMouseOver | ( | ) | const [inline] |
Check if the mouse is currently over the frontend.
int PLCore::Frontend::GetMousePositionX | ( | ) | const [inline] |
Get current mouse cursor X position inside the frontend.
int PLCore::Frontend::GetMousePositionY | ( | ) | const [inline] |
Get current mouse cursor Y position inside the frontend.
bool PLCore::Frontend::IsMouseVisible | ( | ) | const [inline] |
Check if the mouse cursor is visible.
void PLCore::Frontend::SetMouseVisible | ( | bool | bVisible | ) | [inline] |
Set mouse cursor visibility.
[in] | bVisible | Shall the mouse cursor be visible? |
void PLCore::Frontend::SetTrapMouse | ( | bool | bTrap | ) | [inline] |
Trap mouse inside the frontend.
[in] | bTrap | 'true' if the mouse should be trapped inside the frontend, else 'false' |
virtual bool PLCore::Frontend::IsRunning | ( | ) | const [pure virtual] |
Returns whether or not the frontend is currently running.
Implemented in PLCore::FrontendPixelLight, and PLCore::FrontendOpenGL.
virtual PLCORE_API void PLCore::Frontend::OnRun | ( | const String & | sExecutableFilename, |
const Array< String > & | lstArguments | ||
) | [protected, virtual] |
Called when the frontend is run.
[in] | sExecutableFilename | Absolute application executable filename |
[in] | lstArguments | List of arguments to the program |
The default implementation does the following tasks:
Reimplemented in PLCore::FrontendPixelLight.
const FrontendContext& PLCore::Frontend::m_cFrontendContext [protected] |
Frontend context to use (just shared, the given instance must stay valid as long as this frontend lives)
FrontendImpl* PLCore::Frontend::m_pFrontendImpl [protected] |
Pointer to implementation backend, can be a null pointer
|