Gorgon Game Engine
Window Class Reference

This class represents a window. More...

Inheritance diagram for Window:
[legend]

Classes

struct  FullscreenTag
 Fullscreen tag.
 

Public Member Functions

 Window ()
 Empty constructor creates a non-initialized window. More...
 
 Window (const FullscreenTag &, const WindowManager::Monitor &monitor, const std::string &name, const std::string &title="")
 Creates a fullscreen window. More...
 
 Window (const FullscreenTag &tag, const std::string &name, const std::string &title="")
 Creates a fullscreen window. More...
 
 Window (const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (const Geometry::Size &size, const char *name, const char *title, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (const Geometry::Size &size, const std::string &name, const std::string &title, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (const Window &)=delete
 Copy constructor is not allowed. More...
 
 Window (const WindowManager::Monitor &monitor, const Geometry::Size &size, const char *name, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (const WindowManager::Monitor &monitor, const Geometry::Size &size, const std::string &name, bool allowresize=false, bool visible=true)
 Creates a new window at the center of the screen. More...
 
 Window (Geometry::Rectangle rect, const char *name, bool allowresize=false, bool visible=true)
 Creates a new window. More...
 
 Window (Geometry::Rectangle rect, const std::string &name, bool allowresize=false, bool visible=true)
 Creates a new window. More...
 
 Window (Window &&other)
 Move constructor. More...
 
 ~Window ()
 Destroys this window. More...
 
void activatecontext ()
 Activates the GL context of the window. More...
 
void AllowResize ()
 Allows window to be resized by the user. More...
 
void Center ()
 Centers the window to the default monitor. More...
 
void Center (const WindowManager::Monitor &monitor)
 Centers the window to the given monitor. More...
 
void Close ()
 Closes the window. After this function, any use of this object might fail. More...
 
void Destroy ()
 Destroys this window. More...
 
void Focus ()
 Focuses this window. More...
 
Geometry::Bounds GetExteriorBounds () const
 Returns the exterior bounding box of the window. More...
 
const WindowManager::MonitorGetMonitor () const
 Returns the monitor that the window is currently on. More...
 
Geometry::Point GetMouseLocation () const
 Returns the mouse location on the window. More...
 
std::string GetName () const
 Returns the name of the window that is set at creation time. More...
 
Geometry::Point GetPosition () const
 Returns the current position of the window. More...
 
std::string GetTitle () const
 Returns the current title of the window. More...
 
virtual void Hide () override
 Hides this window, may generate Deactivated event. More...
 
void HidePointer ()
 Hides the pointer. More...
 
bool IsClosed () const
 Whether the window is currently closed and cannot be acted on. More...
 
bool IsFocused () const
 Returns if this window has the focus. More...
 
bool IsLeftButtonPressed () const
 Query whether the left mouse button is pressed. More...
 
bool IsLocalPointer () const
 Returns whether the current pointer is a local pointer. More...
 
bool IsMaximized () const
 Returns if the window is maximized. More...
 
bool IsMiddleButtonPressed () const
 Query whether the middle mouse button is pressed. More...
 
bool IsMinimized () const
 Returns if the window is minimized. More...
 
bool IsPointerVisible () const
 Returns whether the pointer is visible. More...
 
bool IsRightButtonPressed () const
 Query whether the right mouse button is pressed. More...
 
virtual bool IsVisible () const override
 Returns whether this layer is effectively visible. More...
 
bool IsX1ButtonPressed () const
 Query whether the X1 mouse button is pressed. More...
 
bool IsX2ButtonPressed () const
 Query whether the X2 mouse button is pressed. More...
 
void Maximize ()
 Maximizes the window to cover the usable area of the screen. More...
 
void Minimize ()
 Minimizes the window. More...
 
void mouse_down (Geometry::Point location, Input::Mouse::Button button)
 These functions are used internally. More...
 
void mouse_event (Input::Mouse::EventType event, Geometry::Point location, Input::Mouse::Button button, float amount)
 These functions are used internally. More...
 
void mouse_location ()
 These functions are used internally. More...
 
void mouse_up (Geometry::Point location, Input::Mouse::Button button)
 These functions are used internally. More...
 
virtual void Move (const Geometry::Point &position) override
 Moves the window to the given position. More...
 
virtual void Move (int x, int y) override
 Moves the window to the given position. More...
 
Windowoperator= (Window &&other)
 Moves another window into this one. More...
 
Input::Mouse::Button PressedButtons () const
 Returns currently pressed buttons. More...
 
void PreventResize ()
 Prevents window to be resized by the user. More...
 
void processmessages ()
 This method is automatically called by the system.Unless its necessary, do not use it. More...
 
virtual void Render () override
 Renders the contents of the window. More...
 
virtual void Resize (const Geometry::Size &size) override
 Resizes the window to the given size. More...
 
virtual void Resize (int width, int height) override
 Resizes the window to the given size. More...
 
void Restore ()
 Restores a minimized or maximized window. More...
 
void SetIcon (const WindowManager::Icon &icon)
 Changes the icon of the window. More...
 
void SetTitle (const std::string &title)
 Changes the title of the window to the specified string. More...
 
virtual void Show () override
 Displays this window, may generate Activated event. More...
 
void ShowPointer ()
 Displays the pointer. More...
 
void Swap (Window &other)
 Used for move semantics. More...
 
void SwitchToLocalPointers ()
 Removes the operating system pointer and starts using Locally defined pointers. More...
 
void SwitchToWMPointers ()
 Stops showing local pointers and makes window manager pointer visible. More...
 
- Public Member Functions inherited from Layer
 Layer ()
 Constructor that sets the layer to cover entire parent, no matter how big it is. More...
 
 Layer (const Geometry::Bounds &bounds)
 Initializing constructor. More...
 
 Layer (const Geometry::Point &location)
 Constructor that places the layer to the given location. More...
 
 Layer (const Layer &)=delete
 Copy constructor is disabled. More...
 
 Layer (Layer &&other)
 Move constructor. More...
 
virtual ~Layer ()
 Destructor. More...
 
Layeroperator= (const Layer &)=delete
 Copy assignment is deleted. More...
 
Layeroperator= (Layer &&other)
 Move assignment. More...
 
virtual bool propagate_mouseevent (Input::Mouse::EventType evet, Geometry::Point location, Input::Mouse::Button button, float amount, MouseHandler &handlers)
 Propagates a mouse event. More...
 
void Swap (Layer &other)
 Swaps two layers, mostly used for move semantics. More...
 
void Add (Layer &layer)
 Adds the given layer as a child. More...
 
void Add (Layer *layer)
 Adds the given layer as a child. More...
 
void setname (std::string value)
 For debugging. More...
 
void Insert (Layer &layer, long under)
 Inserts the given layer before the given index. More...
 
void Insert (Layer *layer, long under)
 Inserts the given layer before the given index. More...
 
void Remove (Layer &layer)
 Removes the given layer. More...
 
void Remove (Layer *layer)
 Removes the given layer. More...
 
bool HasParent () const
 Returns whether this layer has a parent. More...
 
virtual LayerGetParent () const
 Returns the parent of this layer. More...
 
LayerGetTopLevel () const
 Returns the top level layer that contains this layer. More...
 
virtual Geometry::Point TranslateToTopLevel (Geometry::Point location={0, 0}) const
 Translates the given location to the top level. More...
 
LayerGetTopLevel ()
 
Containers::Collection< Layer >::ConstIterator begin () const
 An iterator pointing to the start of the children. More...
 
Containers::Collection< Layer >::ConstIterator end () const
 An iterator pointing to the end of the children. More...
 
Containers::Collection< Layer >::ConstIterator First () const
 An iterator pointing to the start of the children. More...
 
Containers::Collection< Layer >::ConstIterator Last () const
 An iterator pointing to the last item of the children. More...
 
void PlaceBefore (int before)
 Places this layer before the given index. More...
 
void PlaceToTop ()
 Places this layer to the top of the layer stack its in. More...
 
void PlaceToBottom ()
 Places this layer to the bottom of the layer stack. More...
 
int GetOrder () const
 Gets the current order of the stack. More...
 
void SetWidth (int width)
 Resizes the layer to the given size. More...
 
void SetHeight (int height)
 Resizes the layer to the given size. More...
 
void SetBounds (const Geometry::Bounds &bounds)
 Sets the boundaries of this layer. More...
 
Geometry::Size GetSize () const
 Returns the size of the layer. More...
 
Geometry::Size GetCalculatedSize () const
 Returns the size of the layer. More...
 
int GetWidth () const
 Returns the width of the layer. More...
 
int GetHeight () const
 Returns the height of the layer. More...
 
Geometry::Point GetLocation () const
 Returns the current location of the layer. More...
 
int GetLeft () const
 Returns the current location of the layer. More...
 
int GetTop () const
 Returns the current location of the layer. More...
 
Geometry::Bounds GetBounds () const
 Returns the boundaries of the layer. More...
 
Geometry::Bounds GetEffectiveBounds () const
 Returns the effective boundaries of the layer. More...
 

Static Public Member Functions

static Geometry::Size GetMinimumRequiredSize ()
 Returns the minimum size required to fit any window inside. More...
 

Public Attributes

Graphics::PointerStack Pointers
 Pointer system to be used within the window. More...
 
- Public Attributes inherited from Layer
const Containers::Collection< Layer > & Children
 Sub-layers that this layer holds, all the sub-layers are considered to be above current layer. More...
 

Static Public Attributes

static const struct Gorgon::Window::FullscreenTag Fullscreen
 
static const Containers::Collection< Window > & Windows
 List of currently created windows. More...
 
- Static Public Attributes inherited from Layer
static const Geometry::Bounds EntireRegion
 When used as layer bounds, represents the entire region its placed in. More...
 

Protected Member Functions

 Window (const WindowManager::Monitor &monitor, Geometry::Rectangle rect, const std::string &name, const std::string &title, bool allowresize, bool visible)
 
virtual void added (Layer &layer) override
 Will be called when a layer is added. More...
 
void deleting (Layer *layer)
 
virtual void located (Layer *) override
 A window cannot be placed in another layer. This function always fails. More...
 
- Protected Member Functions inherited from Layer
void dotransformandclip (bool inverse=false)
 Performs transformation and clipping. Use inverse for reverse mapping for mouse events. More...
 
virtual void removed (Layer &layer)
 Will be called when a layer is removed. More...
 
void reverttransformandclip ()
 Reverts previously done transformation. More...
 

Events

Event< WindowFocusedEvent
 Called when this window is focused. More...
 
Event< WindowLostFocusEvent
 Called when this window is deactivated. More...
 
Event< WindowDestroyedEvent
 Called when this window is destroyed. More...
 
Event< Window, bool & > ClosingEvent
 Called when user tries to close the window. More...
 
Event< WindowMovedEvent
 Called after the window is moved, either by the user or programmatically. More...
 
Event< WindowResizedEvent
 Called after the window is resized, either by the user or programmatically. More...
 
Event< WindowMinimizedEvent
 Called after the window is minimized, either by the user or programmatically. More...
 
Event< WindowRestoredEvent
 Called after the window is restored from minimized state, either by the user or programmatically. More...
 
ConsumableEvent< Window, Input::Key, float > KeyEvent
 Called when a key is pressed or released. More...
 
ConsumableEvent< Window, Input::Keyboard::CharCharacterEvent
 Called when a character is received. More...
 

Additional Inherited Members

- Protected Attributes inherited from Layer
Geometry::Bounds bounds
 Bounds of this layer. More...
 
Containers::Collection< Layerchildren
 Child layers that this layer holds, all child layers are considered to be above current layer. More...
 
bool isvisible
 Whether this layer is visible, invisible layers will not be drawn or receive any events. More...
 
std::string name
 For debugging. More...
 
Layerparent
 Parent layer, could be nullptr. More...
 

Detailed Description

This class represents a window.

Constructor & Destructor Documentation

◆ Window() [1/14]

Window ( )

Empty constructor creates a non-initialized window.

This constructor is there support move semantics. Any action on non-initialized window may result in a crash.

◆ Window() [2/14]

Window ( Geometry::Rectangle  rect,
const std::string &  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window.

Parameters
rectthe position and the interior size of the window unless use outer metrics is set to true
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [3/14]

Window ( Geometry::Rectangle  rect,
const char *  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window.

Parameters
rectthe position and the interior size of the window unless use outer metrics is set to true
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [4/14]

Window ( const Geometry::Size size,
const std::string &  name,
const std::string &  title,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
sizeof the window
nameof the window
titleof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [5/14]

Window ( const Geometry::Size size,
const char *  name,
const char *  title,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
sizeof the window
nameof the window
titleof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [6/14]

Window ( const Geometry::Size size,
const std::string &  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
sizeof the window
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [7/14]

Window ( const Geometry::Size size,
const char *  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
sizeof the window
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [8/14]

Window ( const WindowManager::Monitor monitor,
const Geometry::Size size,
const std::string &  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
monitorthat the window will be centered on
sizeof the window
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [9/14]

Window ( const WindowManager::Monitor monitor,
const Geometry::Size size,
const char *  name,
bool  allowresize = false,
bool  visible = true 
)

Creates a new window at the center of the screen.

Parameters
monitorthat the window will be centered on
sizeof the window
nameof the window
visibleafter creation, window will be visible or invisible depending on this value.

◆ Window() [10/14]

Window ( const FullscreenTag &  ,
const WindowManager::Monitor monitor,
const std::string &  name,
const std::string &  title = "" 
)

◆ Window() [11/14]

Window ( const FullscreenTag &  tag,
const std::string &  name,
const std::string &  title = "" 
)

Creates a fullscreen window.

Fullscreen windows do not have chrome and covers entire screen, including any panels it contains.

◆ Window() [12/14]

Window ( const Window )
delete

Copy constructor is not allowed.

◆ Window() [13/14]

Window ( Window &&  other)

Move constructor.

◆ ~Window()

~Window ( )

Destroys this window.

References Window::Destroy().

◆ Window() [14/14]

Member Function Documentation

◆ activatecontext()

void activatecontext ( )

Activates the GL context of the window.

This function is used internally and should not be called unless necessary.

◆ added()

void added ( Layer layer)
overrideprotectedvirtual

Will be called when a layer is added.

This function will even be called when the given layer was already in the children.

Reimplemented from Layer.

Reimplemented in Window.

References Layer::children.

◆ AllowResize()

void AllowResize ( )

Allows window to be resized by the user.

References windowdata::handle.

◆ Center() [1/2]

void Center ( )

Centers the window to the default monitor.

References Monitor::Primary().

◆ Center() [2/2]

void Center ( const WindowManager::Monitor monitor)

Centers the window to the given monitor.

References Window::Center(), Window::GetExteriorBounds(), Layer::GetSize(), Monitor::GetUsable(), and Window::Move().

◆ Close()

void Close ( )

Closes the window. After this function, any use of this object might fail.

References Window::DestroyedEvent, and windowdata::handle.

◆ deleting()

void deleting ( Layer layer)
protected

◆ Destroy()

void Destroy ( )

Destroys this window.

References Window::Close().

◆ Focus()

void Focus ( )

Focuses this window.

References windowdata::handle, and Gorgon::WindowManager::XA_NET_ACTIVE_WINDOW.

◆ GetExteriorBounds()

Geometry::Bounds GetExteriorBounds ( ) const

Returns the exterior bounding box of the window.

May throw or return invalid values if the window is not visible

References windowdata::handle, Gorgon::swap(), and Gorgon::WindowManager::XA_NET_FRAME_EXTENTS.

◆ GetMinimumRequiredSize()

Geometry::Size GetMinimumRequiredSize ( )
static

Returns the minimum size required to fit any window inside.

References basic_Size< T_ >::Height, basic_Size< T_ >::Width, and Window::Windows.

◆ GetMonitor()

const WindowManager::Monitor & GetMonitor ( ) const

Returns the monitor that the window is currently on.

May throw if the window is not visible, will throw if the window is not on any currently known monitors. If this case occurs consider refreshing monitor list.

References basic_Bounds< T_ >::Center(), Window::GetExteriorBounds(), Gorgon::Geometry::IsInside(), and Monitor::Monitors().

◆ GetMouseLocation()

Geometry::Point GetMouseLocation ( ) const

Returns the mouse location on the window.

If the cursor is outside the window and its position cannot be determined (-1, -1) is returned. This function can return coordinates outside the bounds of the window.

◆ GetName()

std::string GetName ( ) const

Returns the name of the window that is set at creation time.

◆ GetPosition()

Geometry::Point GetPosition ( ) const

Returns the current position of the window.

This value is measured from the (0,0) of the virtual screen to the top-left of the window chrome.

References Window::GetExteriorBounds(), and basic_Bounds< T_ >::TopLeft().

◆ GetTitle()

std::string GetTitle ( ) const

Returns the current title of the window.

◆ Hide()

void Hide ( )
overridevirtual

Hides this window, may generate Deactivated event.

Reimplemented from Layer.

References windowdata::handle, Layer::Hide(), and windowdata::ismapped.

◆ HidePointer()

void HidePointer ( )

Hides the pointer.

If local pointers are activated, this function will hide local pointer, otherwise it will hide window manager pointer. In both cases, after calling to this function, there will be no visible pointer on the screen.

References Layer::Clear(), windowdata::handle, Layer::Hide(), and windowdata::pointerdisplayed.

◆ IsClosed()

bool IsClosed ( ) const

Whether the window is currently closed and cannot be acted on.

References windowdata::handle.

◆ IsFocused()

bool IsFocused ( ) const

Returns if this window has the focus.

References windowdata::handle.

◆ IsLeftButtonPressed()

bool IsLeftButtonPressed ( ) const

Query whether the left mouse button is pressed.

References Gorgon::Input::Keyboard::Keycodes::Left.

◆ IsLocalPointer()

bool IsLocalPointer ( ) const

Returns whether the current pointer is a local pointer.

◆ IsMaximized()

bool IsMaximized ( ) const

Returns if the window is maximized.

◆ IsMiddleButtonPressed()

bool IsMiddleButtonPressed ( ) const

Query whether the middle mouse button is pressed.

References Gorgon::Input::Mouse::Middle.

◆ IsMinimized()

bool IsMinimized ( ) const

Returns if the window is minimized.

◆ IsPointerVisible()

bool IsPointerVisible ( ) const

Returns whether the pointer is visible.

◆ IsRightButtonPressed()

bool IsRightButtonPressed ( ) const

Query whether the right mouse button is pressed.

References Gorgon::Input::Keyboard::Keycodes::Right.

◆ IsVisible()

virtual bool IsVisible ( ) const
overridevirtual

Returns whether this layer is effectively visible.

Reimplemented from Layer.

Reimplemented in Window.

References Layer::isvisible.

◆ IsX1ButtonPressed()

bool IsX1ButtonPressed ( ) const

Query whether the X1 mouse button is pressed.

References Gorgon::Input::Mouse::X1.

◆ IsX2ButtonPressed()

bool IsX2ButtonPressed ( ) const

Query whether the X2 mouse button is pressed.

References Gorgon::Input::Mouse::X2.

◆ located()

virtual void located ( Layer )
overrideprotectedvirtual

A window cannot be placed in another layer. This function always fails.

Reimplemented from Layer.

References Gorgon::Utils::ASSERT_FALSE().

◆ Maximize()

void Maximize ( )

Maximizes the window to cover the usable area of the screen.

Use Restore function to return the window to its previous size and position. Maximize might take time.

References windowdata::handle, Gorgon::WindowManager::XA_NET_WM_STATE, Gorgon::WindowManager::XA_NET_WM_STATE_ADD, Gorgon::WindowManager::XA_NET_WM_STATE_MAXIMIZED_HORZ, and Gorgon::WindowManager::XA_NET_WM_STATE_MAXIMIZED_VERT.

◆ Minimize()

void Minimize ( )

Minimizes the window.

Use Restore function to return it to its previous state.

References windowdata::handle.

◆ mouse_down()

◆ mouse_event()

void mouse_event ( Input::Mouse::EventType  event,
Geometry::Point  location,
Input::Mouse::Button  button,
float  amount 
)

These functions are used internally.

References Layer::bounds, Gorgon::Clip, Layer::propagate_mouseevent(), and Gorgon::Transform.

◆ mouse_location()

◆ mouse_up()

◆ Move() [1/2]

void Move ( const Geometry::Point position)
overridevirtual

◆ Move() [2/2]

virtual void Move ( int  x,
int  y 
)
overridevirtual

Moves the window to the given position.

Reimplemented from Layer.

References Window::Move().

◆ operator=()

Window& operator= ( Window &&  other)

Moves another window into this one.

References Window::Swap().

◆ PressedButtons()

Input::Mouse::Button PressedButtons ( ) const

Returns currently pressed buttons.

◆ PreventResize()

void PreventResize ( )

Prevents window to be resized by the user.

References Layer::GetSize(), and windowdata::handle.

◆ processmessages()

◆ Render()

◆ Resize() [1/2]

void Resize ( const Geometry::Size size)
overridevirtual

Resizes the window to the given size.

The given size is considered as the interior region of the window. The restrictions for the smallest sized window might change depending on the window manager or theme. Largest window size can be obtained using UsableScreenRegion however, this size does not exclude window chrome. This function resizes all window sized layers.

Reimplemented from Layer.

References windowdata::handle, basic_Size< T_ >::Height, and basic_Size< T_ >::Width.

◆ Resize() [2/2]

virtual void Resize ( int  width,
int  height 
)
overridevirtual

Resizes the window to the given size.

The given size is considered as the interior region of the window. The restrictions for the smallest sized window might change depending on the window manager or theme. Largest window size can be obtained using UsableScreenRegion however, this size does not exclude window chrome. This function resizes all window sized layers.

Reimplemented from Layer.

References Window::Resize().

◆ Restore()

void Restore ( )

Restores a minimized or maximized window.

◆ SetIcon()

void SetIcon ( const WindowManager::Icon icon)

◆ SetTitle()

void SetTitle ( const std::string &  title)

Changes the title of the window to the specified string.

References windowdata::handle.

◆ Show()

void Show ( )
overridevirtual

Displays this window, may generate Activated event.

Reimplemented from Layer.

References windowdata::handle, windowdata::ismapped, windowdata::move, windowdata::moveto, Layer::Show(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.

◆ ShowPointer()

void ShowPointer ( )

Displays the pointer.

If local pointers are activated, this function will show local pointer, otherwise it will show window manager pointer

References windowdata::handle, windowdata::pointerdisplayed, and Layer::Show().

◆ Swap()

◆ SwitchToLocalPointers()

void SwitchToLocalPointers ( )

Removes the operating system pointer and starts using Locally defined pointers.

If there are no pointers added to the Pointers object, this function will throw. After switching, ShowPointer and HidePointer will show and hide local pointers not OS pointers. Calling this function will show the local pointer.

References Window::HidePointer(), and Window::ShowPointer().

◆ SwitchToWMPointers()

void SwitchToWMPointers ( )

Stops showing local pointers and makes window manager pointer visible.

References Window::HidePointer(), and Window::ShowPointer().

Member Data Documentation

◆ CharacterEvent

ConsumableEvent<Window, Input::Keyboard::Char> CharacterEvent

Called when a character is received.

This event is raised for regular characters that can be printed. If a key is handled in keypress event, this event will not be fired. This event will be called multiple times when the key repeats.

◆ ClosingEvent

Event<Window, bool&> ClosingEvent

Called when user tries to close the window.

Will not be called if window is closed using Destructor or Close function

Parameters:

allow (bool &): setting this value to false will stop window being closed.

◆ DestroyedEvent

Event<Window> DestroyedEvent

Called when this window is destroyed.

Note that at this point, any reference to this object may fail.

◆ FocusedEvent

Event<Window> FocusedEvent

Called when this window is focused.

◆ Fullscreen

const Window::FullscreenTag Fullscreen
static

◆ KeyEvent

ConsumableEvent<Window, Input::Key, float> KeyEvent

Called when a key is pressed or released.

This key could be a keyboard key or any other controller key including mouse. In case of mouse, this method will be triggered if mouse call is not handled by layers.

If the input device is keyboard, key down event (amount=1) is repeated if the first event is handled. The repeats will only be sent to the handler of the event. Additionally, Key up event (amount=0) is sent only to handler, if key down is handled otherwise it will be sent to all listeners.

Parameters:

Key (Input::Key): The key that is pressed or released Amount (float): Depending on the device this can be a boolean 0 and 1, number of successive key strokes or amount of pressure (0 to 1) in analog controllers

◆ LostFocusEvent

Event<Window> LostFocusEvent

Called when this window is deactivated.

◆ MinimizedEvent

Event<Window> MinimizedEvent

Called after the window is minimized, either by the user or programmatically.

◆ MovedEvent

Event<Window> MovedEvent

Called after the window is moved, either by the user or programmatically.

◆ Pointers

Pointer system to be used within the window.

◆ ResizedEvent

Event<Window> ResizedEvent

Called after the window is resized, either by the user or programmatically.

◆ RestoredEvent

Event<Window> RestoredEvent

Called after the window is restored from minimized state, either by the user or programmatically.

◆ Windows

const Containers::Collection< Window > & Windows
static

List of currently created windows.


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