![]() |
LLGL 0.05 Beta
|
Window interface for desktop platforms. More...
#include <Window.h>
Classes | |
| class | EventListener |
| Interface for all window event listeners. More... | |
Public Member Functions | |
| ~Window () | |
| Releases the internal data. | |
| virtual void | SetPosition (const Offset2D &position)=0 |
| Sets the window position relative to its parent. | |
| virtual Offset2D | GetPosition () const =0 |
| Returns the window position relative to its parent (which can also be the display). | |
| virtual void | SetSize (const Extent2D &size, bool useClientArea=true)=0 |
| Sets the either the overall window size or the client area size. By default the client area size is set. | |
| virtual Extent2D | GetSize (bool useClientArea=true) const =0 |
| Returns either the window size (including frame and title bar) or the client area size (both in window coordinates). By default the client area size is returned. | |
| virtual void | SetTitle (const UTF8String &title)=0 |
| Sets the window title as UTF8 string. | |
| virtual UTF8String | GetTitle () const =0 |
| Returns the window title as UTF8 string. | |
| virtual void | Show (bool show=true)=0 |
| Shows or hides the window. | |
| virtual bool | IsShown () const =0 |
| Returns true if this window is visible. | |
| virtual void | SetDesc (const WindowDescriptor &desc)=0 |
| Sets the window attributes according to the specified window descriptor. | |
| virtual WindowDescriptor | GetDesc () const =0 |
| Queries a window descriptor, which describes the attributes of this window. | |
| bool | AdaptForVideoMode (Extent2D *resolution, bool *fullscreen) override |
| Adapts the window for the specified video mode. | |
| Display * | FindResidentDisplay () const override final |
| Searches the entire list of displays until a display is found where more than the half of this window's client area is visible. | |
| bool | HasFocus () const |
| Returns true if this window has the keyboard focus. | |
| bool | HasQuit () const |
| Returns true if this window is in the 'Quit' state. | |
| void | SetUserData (void *userData) |
| Sets a raw pointer to some user defined data. The initial value is null. | |
| void * | GetUserData () const |
| Returns the raw pointer that was previously set with SetUserData. The initial value is null. | |
| void | AddEventListener (const std::shared_ptr< EventListener > &eventListener) |
| Adds the specified event listener to this window. | |
| void | RemoveEventListener (const EventListener *eventListener) |
| Removes the specified event listener from this window. | |
| void | PostQuit () |
| Posts a 'Quit' event to all event listeners if the window is not yet in the 'Quit' state. | |
| void | PostKeyDown (Key keyCode) |
| Posts a 'KeyDown' event to all event listeners. | |
| void | PostKeyUp (Key keyCode) |
| void | PostDoubleClick (Key keyCode) |
| void | PostChar (wchar_t chr) |
| void | PostWheelMotion (int motion) |
| void | PostLocalMotion (const Offset2D &position) |
| void | PostGlobalMotion (const Offset2D &motion) |
| void | PostResize (const Extent2D &clientAreaSize) |
| void | PostUpdate () |
| Posts an 'Update' timer event with to all event listeners. | |
| void | PostGetFocus () |
| Posts a 'GetFocus' event to all event listeners. | |
| void | PostLostFocus () |
| Posts a 'LostFocus' event to all event listeners. | |
| Public Member Functions inherited from LLGL::Surface | |
| virtual bool | GetNativeHandle (void *nativeHandle, std::size_t nativeHandleSize)=0 |
| Returns the native surface handle. | |
| virtual Extent2D | GetContentSize () const =0 |
| Returns the size (in pixels) of the surface content, i.e. the drawable area. | |
| Public Member Functions inherited from LLGL::Interface | |
| virtual bool | IsInstanceOf (int id) const |
| Returns true if this object is an instance of the specified interface. | |
| Public Member Functions inherited from LLGL::NonCopyable | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
| virtual | ~NonCopyable ()=default |
Static Public Member Functions | |
| static std::unique_ptr< Window > | Create (const WindowDescriptor &desc) |
| Creates a platform specific instance of the Window interface. | |
| Static Public Member Functions inherited from LLGL::Surface | |
| static bool | ProcessEvents () |
| Processes all windowing system events, i.e. input-, movement-, resize-, and other events for all surfaces associated with the host process. | |
Protected Member Functions | |
| Window () | |
| Allocates the internal data. | |
| Protected Member Functions inherited from LLGL::NonCopyable | |
| NonCopyable ()=default | |
Window interface for desktop platforms.
| LLGL::Window::~Window | ( | ) |
Releases the internal data.
|
protected |
Allocates the internal data.
|
overridevirtual |
Adapts the window for the specified video mode.
Implements LLGL::Surface.
| void LLGL::Window::AddEventListener | ( | const std::shared_ptr< EventListener > & | eventListener | ) |
Adds the specified event listener to this window.
|
static |
|
finaloverridevirtual |
Searches the entire list of displays until a display is found where more than the half of this window's client area is visible.
Implements LLGL::Surface.
|
pure virtual |
Queries a window descriptor, which describes the attributes of this window.
|
pure virtual |
Returns the window position relative to its parent (which can also be the display).
|
pure virtual |
Returns either the window size (including frame and title bar) or the client area size (both in window coordinates). By default the client area size is returned.
|
pure virtual |
Returns the window title as UTF8 string.
| void * LLGL::Window::GetUserData | ( | ) | const |
Returns the raw pointer that was previously set with SetUserData. The initial value is null.
| bool LLGL::Window::HasFocus | ( | ) | const |
Returns true if this window has the keyboard focus.
| bool LLGL::Window::HasQuit | ( | ) | const |
Returns true if this window is in the 'Quit' state.
|
pure virtual |
Returns true if this window is visible.
| void LLGL::Window::PostChar | ( | wchar_t | chr | ) |
| void LLGL::Window::PostDoubleClick | ( | Key | keyCode | ) |
| void LLGL::Window::PostGetFocus | ( | ) |
Posts a 'GetFocus' event to all event listeners.
| void LLGL::Window::PostGlobalMotion | ( | const Offset2D & | motion | ) |
| void LLGL::Window::PostKeyDown | ( | Key | keyCode | ) |
Posts a 'KeyDown' event to all event listeners.
| void LLGL::Window::PostKeyUp | ( | Key | keyCode | ) |
| void LLGL::Window::PostLocalMotion | ( | const Offset2D & | position | ) |
| void LLGL::Window::PostLostFocus | ( | ) |
Posts a 'LostFocus' event to all event listeners.
| void LLGL::Window::PostQuit | ( | ) |
Posts a 'Quit' event to all event listeners if the window is not yet in the 'Quit' state.
veto flag to false within the OnQuit callback, the window will not be put into 'Quit' state. | void LLGL::Window::PostResize | ( | const Extent2D & | clientAreaSize | ) |
| void LLGL::Window::PostUpdate | ( | ) |
Posts an 'Update' timer event with to all event listeners.
| void LLGL::Window::PostWheelMotion | ( | int | motion | ) |
| void LLGL::Window::RemoveEventListener | ( | const EventListener * | eventListener | ) |
Removes the specified event listener from this window.
|
pure virtual |
Sets the window attributes according to the specified window descriptor.
|
pure virtual |
Sets the window position relative to its parent.
|
pure virtual |
Sets the either the overall window size or the client area size. By default the client area size is set.
|
pure virtual |
Sets the window title as UTF8 string.
| void LLGL::Window::SetUserData | ( | void * | userData | ) |
Sets a raw pointer to some user defined data. The initial value is null.
|
pure virtual |
Shows or hides the window.