AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::DOM::Window Class Reference

Represents a display window in the AeonGUI framework. More...

#include <aeongui/dom/Window.hpp>

Inheritance diagram for AeonGUI::DOM::Window:
[legend]
Collaboration diagram for AeonGUI::DOM::Window:
[legend]

Public Member Functions

 Window ()
 Default constructor. Creates an empty window.
 Window (uint32_t aWidth, uint32_t aHeight)
 Construct a window with the given viewport size.
 ~Window () override final
 Destructor.
void ResizeViewport (uint32_t aWidth, uint32_t aHeight)
 Resize the rendering viewport.
const uint8_t * GetPixels () const
 Get a pointer to the rendered pixel data.
size_t GetWidth () const
 Get the window width in pixels.
size_t GetHeight () const
 Get the window height in pixels.
size_t GetStride () const
 Get the stride (bytes per row) of the pixel buffer.
void Draw ()
 Render the current document to the internal canvas.
const Documentdocument () const
 Get the associated Document.
Locationlocation () const
 Get the Location object.
Public Member Functions inherited from AeonGUI::DOM::EventTarget
virtual ~EventTarget ()=0
 Virtual destructor.
void addEventListener (const DOMString &type, EventListener *callback, const std::variant< std::monostate, AddEventListenerOptions, bool > &options={})
 Register an event listener.
void removeEventListener (const DOMString &type, EventListener *callback, const std::variant< std::monostate, EventListenerOptions, bool > &options={})
 Unregister an event listener.
virtual bool dispatchEvent (Event &event)
 Dispatch an event to this target.

Detailed Description

Represents a display window in the AeonGUI framework.

Owns a Document, a CairoCanvas, and a Location. Renders the document into a pixel buffer that can be blitted to the screen.

See also
https://html.spec.whatwg.org/multipage/nav-history-apis.html#window

Constructor & Destructor Documentation

◆ Window()

AeonGUI::DOM::Window::Window ( uint32_t aWidth,
uint32_t aHeight )

Construct a window with the given viewport size.

Parameters
aWidthInitial width in pixels.
aHeightInitial height in pixels.

Member Function Documentation

◆ document()

const Document * AeonGUI::DOM::Window::document ( ) const

Get the associated Document.

DOM Properties and Methods

Returns
Pointer to the Document, or nullptr.

◆ GetHeight()

size_t AeonGUI::DOM::Window::GetHeight ( ) const

Get the window height in pixels.

Returns
The height.

◆ GetPixels()

const uint8_t * AeonGUI::DOM::Window::GetPixels ( ) const

Get a pointer to the rendered pixel data.

Returns
Pointer to BGRA pixel data.

◆ GetStride()

size_t AeonGUI::DOM::Window::GetStride ( ) const

Get the stride (bytes per row) of the pixel buffer.

Returns
The stride in bytes.

◆ GetWidth()

size_t AeonGUI::DOM::Window::GetWidth ( ) const

Get the window width in pixels.

Returns
The width.

◆ location()

Location & AeonGUI::DOM::Window::location ( ) const

Get the Location object.

Returns
Reference to the window's Location.

◆ ResizeViewport()

void AeonGUI::DOM::Window::ResizeViewport ( uint32_t aWidth,
uint32_t aHeight )

Resize the rendering viewport.

Parameters
aWidthNew width in pixels.
aHeightNew height in pixels.

The documentation for this class was generated from the following files:
  • include/aeongui/dom/Window.hpp
  • core/dom/Window.cpp