Kanzi 4.0.0-beta2
kanzi::emscripten::DefaultEmscriptenGraphicsOutput Class Reference

Class representing a default Emscripten graphics output. More...

#include <kanzi/core.ui/platform/graphics_output/emscripten/default_emscripten_graphics_output.hpp>

Inheritance diagram for kanzi::emscripten::DefaultEmscriptenGraphicsOutput:
[legend]

Public Member Functions

 DefaultEmscriptenGraphicsOutput (const DefaultEmscriptenGraphicsOutputProperties &properties)
 Constructor.
 
void gatherEvents (EventQueue &queue) override
 Amends the given event queue with events received so far.
 
KZ_NO_DISCARD optional< NativeEventHandlegetNativeEventHandle () const noexcept override
 Returns a waitable event handle for this event source, if available.
 
KZ_NO_DISCARD Matrix4x4 getTargetTransformation () const noexcept override
 Returns the target transformation.
 
KZ_NO_DISCARD optional< unsigned intgetWindowHeight () const noexcept
 Returns the active window height.
 
KZ_NO_DISCARD optional< unsigned intgetWindowWidth () const noexcept
 Returns the active window width.
 
void logWindowSize () const noexcept
 Prints the active window size to log.
 
- Public Member Functions inherited from kanzi::GraphicsOutput
KZ_NO_DISCARD Vector2 getDpi () const noexcept
 Returns the resolution of the target coordinate system in dots per inch.
 
KZ_NO_DISCARD unsigned int getHeight () const noexcept
 Returns the height of layout area in the target coordinate system.
 
KZ_NO_DISCARD unsigned int getWidth () const noexcept
 Returns the width of layout area in the target coordinate system.
 
virtual ~GraphicsOutput ()=default
 Destructor.
 
- Public Member Functions inherited from kanzi::EventSource
virtual ~EventSource ()=default
 Destructor.
 
- Public Member Functions inherited from kanzi::WakeupSignalSource
WakeupSignalSourceoperator= (const WakeupSignalSource &)=default
 Copy assignment operator.
 
WakeupSignalSourceoperator= (WakeupSignalSource &&) noexcept=default
 Move assignment operator.
 
 WakeupSignalSource ()=default
 Constructor.
 
 WakeupSignalSource (const WakeupSignalSource &)=default
 Copy constructor.
 
 WakeupSignalSource (WakeupSignalSource &&) noexcept=default
 Move constructor.
 
virtual ~WakeupSignalSource ()=default
 Destructor.
 
- Public Member Functions inherited from kanzi::FramebufferGraphicsOutput
 FramebufferGraphicsOutput ()
 Constructor.
 
KZ_NO_DISCARD const FramebuffergetFramebuffer () const noexcept
 Returns the framebuffer for the Graphics Output.
 
KZ_NO_DISCARD FramebuffergetFramebuffer () noexcept
 Returns the framebuffer for the Graphics Output.
 
virtual ~FramebufferGraphicsOutput ()=default
 Destructor.
 

Protected Member Functions

void setTargetTransformation (Matrix4x4 targetTransformation) noexcept
 Sets the target transformation.
 
bool updateCachedValues (unsigned int width, unsigned int height) noexcept
 Updates all cached values from given layout size.
 
- Protected Member Functions inherited from kanzi::GraphicsOutput
void updateDpi (Vector2 dpi)
 Updates the target layout area resolution.
 
void updateSize (unsigned int width, unsigned int height)
 Updates the target layout area size.
 

Detailed Description

Class representing a default Emscripten graphics output.

Constructor & Destructor Documentation

◆ DefaultEmscriptenGraphicsOutput()

kanzi::emscripten::DefaultEmscriptenGraphicsOutput::DefaultEmscriptenGraphicsOutput ( const DefaultEmscriptenGraphicsOutputProperties & properties)
explicit

Constructor.

Parameters
propertiesSpecifies properties to request for the graphics output.

Member Function Documentation

◆ logWindowSize()

void kanzi::emscripten::DefaultEmscriptenGraphicsOutput::logWindowSize ( ) const
noexcept

Prints the active window size to log.

◆ gatherEvents()

void kanzi::emscripten::DefaultEmscriptenGraphicsOutput::gatherEvents ( EventQueue & queue)
overridevirtual

Amends the given event queue with events received so far.

Parameters
queueEvent queue to be amended. Do not clear nor assume to be empty.

Implements kanzi::EventSource.

◆ getNativeEventHandle()

KZ_NO_DISCARD optional< NativeEventHandle > kanzi::emscripten::DefaultEmscriptenGraphicsOutput::getNativeEventHandle ( ) const
overridevirtualnoexcept

Returns a waitable event handle for this event source, if available.

Return values
nulloptGetting the event handle failed.
Returns
The native event handle.

Implements kanzi::WakeupSignalSource.

◆ getTargetTransformation()

KZ_NO_DISCARD Matrix4x4 kanzi::emscripten::DefaultEmscriptenGraphicsOutput::getTargetTransformation ( ) const
overridevirtualnoexcept

Returns the target transformation.

Returns
Target transformation matrix.

Implements kanzi::FramebufferGraphicsOutput.

◆ getWindowWidth()

KZ_NO_DISCARD optional< unsigned int > kanzi::emscripten::DefaultEmscriptenGraphicsOutput::getWindowWidth ( ) const
noexcept

Returns the active window width.

Return values
nulloptGetting the width failed.
Returns
Window width in implementation defined units.

◆ getWindowHeight()

KZ_NO_DISCARD optional< unsigned int > kanzi::emscripten::DefaultEmscriptenGraphicsOutput::getWindowHeight ( ) const
noexcept

Returns the active window height.

Return values
nulloptGetting the height failed.
Returns
Window height in implementation defined units.

◆ setTargetTransformation()

void kanzi::emscripten::DefaultEmscriptenGraphicsOutput::setTargetTransformation ( Matrix4x4 targetTransformation)
inlineprotectednoexcept

Sets the target transformation.

Parameters
targetTransformationThe target transformation matrix.

◆ updateCachedValues()

bool kanzi::emscripten::DefaultEmscriptenGraphicsOutput::updateCachedValues ( unsigned int width,
unsigned int height )
protectednoexcept

Updates all cached values from given layout size.

Parameters
widthLayout area width in pixels.
heightLayout area height in pixels.
Returns
True, if the given values were new.

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