Kanzi 4.0.0-beta2
kanzi::qnx::QnxWindowMethods Class Reference

Class representing QNX window methods. More...

#include <kanzi/platform/platform/windowing_ng/qnx_screen/qnx_screen_window.hpp>

Inheritance diagram for kanzi::qnx::QnxWindowMethods:
[legend]

Public Member Functions

bool bringToFront () const noexcept
 Brings the window to forefront.
 
bool createBuffers (int bufferCount) const noexcept
 Creates buffers for this window.
 
bool createWindowGroup (string_view windowGroupName) const noexcept
 Creates a window group with the specified name.
 
KZ_NO_DISCARD optional< windowing::SizegetBufferSize () const noexcept
 Tries to get the buffer size for this window.
 
KZ_NO_DISCARD optional< windowing::PositiongetPosition () const noexcept
 Tries to get the x and y screen coordinates for this window.
 
KZ_NO_DISCARD optional< string > getPropertyIDString (unsigned int bufferSize) const noexcept
 Tries to get the current ID string for this window.
 
KZ_NO_DISCARD optional< void * > getPropertyUserHandle () const noexcept
 Gets user data for this window.
 
KZ_NO_DISCARD optional< windowing::SizegetSize () const noexcept
 Tries to get the size for this window.
 
KZ_NO_DISCARD optional< intgetUsageFlags () const noexcept
 Gets usage flags for this window.
 
KZ_NO_DISCARD optional< string > getWindowGroupName () const noexcept
 Gets the window group name.
 
KZ_NO_DISCARD optional< windowing::SizeUgetWindowSizeU () const noexcept
 Tries to get window size in unsigned format.
 
KZ_NO_DISCARD optional< string > getWindowTitle () const noexcept
 Tries to get the window title.
 
bool hide () const noexcept
 Hides this window.
 
bool joinWindowGroup (string_view windowGroupName) const noexcept
 Joins a window group with the specified name.
 
bool leaveWindowGroup () const noexcept
 Leaves a window group.
 
bool setBufferSize (windowing::Size bufferSize) const noexcept
 Sets buffer size for this window.
 
bool setFormat (int format) const noexcept
 Sets pixel format property for this window.
 
bool setPipelineID (int id) const noexcept
 Sets screen pipeline ID for this window.
 
bool setPosition (windowing::Position windowPosition) const noexcept
 Sets position for this window.
 
bool setPropertyDisplay (const QnxDisplay &qnxDisplay) const noexcept
 Sets display property for this window.
 
bool setPropertyIDString (string_view propertyString) const noexcept
 Sets a property ID string for this window.
 
bool setPropertyUserHandle (void *userHandle) const noexcept
 Sets user data for this window.
 
bool setSize (windowing::Size windowSize) const noexcept
 Sets size for this window.
 
bool setSwapInterval (int interval) const noexcept
 Sets minimum number of displayed video frames before a buffer swap for this window.
 
bool setTransparency (int level) const noexcept
 Sets transparency level for this window.
 
bool setUsageFlags (int usageFlags) const noexcept
 Sets usage flags for this window.
 
bool setWindowPipelineID (int id) const noexcept
 Sets pipeline ID for window.
 
bool setWindowTitle (string_view windowTitle) const noexcept
 Sets a window title.
 
bool setZOrder (int zorder) const noexcept
 Sets z-order for this window.
 
bool show () const noexcept
 Shows this window.
 
- Public Member Functions inherited from kanzi::qnx::QnxPropertyHost< QnxWindowMethods, KANZI_GENERATE_QNX_PROPERTY_HOST_SIGNATURE(window)>
KZ_NO_DISCARD optional< string > getPropertyCv (size_t stringBufferSize, int propertyName) const noexcept
 Gets QNX property consisting of a string.
 
KZ_NO_DISCARD optional< vector< int > > getPropertyIv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of ints.
 
KZ_NO_DISCARD optional< int > getPropertyIvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single int.
 
KZ_NO_DISCARD optional< vector< long long > > getPropertyLlv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of long longs.
 
KZ_NO_DISCARD optional< long long > getPropertyLlvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single long long.
 
KZ_NO_DISCARD optional< vector< T > > getPropertyPv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of pointers.
 
KZ_NO_DISCARD optional< T > getPropertyPvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single pointer.
 
bool setPropertyCv (int propertyName, string_view propertyValue) const noexcept
 Sets QNX property consisting of a string.
 
bool setPropertyIv (int propertyName, int propertyValue) const noexcept
 Sets QNX property consisting of a single int.
 
bool setPropertyIv (int propertyName, span< int > propertyValue) const noexcept
 Sets QNX property consisting of ints.
 
bool setPropertyLlv (int propertyName, long long propertyValue) const noexcept
 Sets QNX property consisting of a single long long.
 
bool setPropertyLlv (int propertyName, span< long long > propertyValue) const noexcept
 Sets QNX property consisting of long longs.
 
bool setPropertyPv (int propertyName, span< void * > propertyValue) const noexcept
 Sets QNX property consisting of pointers.
 
bool setPropertyPv (int propertyName, void *propertyValue) const noexcept
 Sets QNX property consisting of a single pointer.
 

Protected Member Functions

 QnxWindowMethods () noexcept=default
 Constructor.
 
 QnxWindowMethods (const NativeHandleType &handle) noexcept
 Constructor.
 
- Protected Member Functions inherited from kanzi::OptionalHandle< screen_window_t, nullptr, screen_destroy_window >
KZ_NO_DISCARD optional< screen_window_t > createOptional () const noexcept
 Creates a kanzi::optional copy of the native handle.
 
KZ_NO_DISCARD const screen_window_t get () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD screen_window_t get () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD const screen_window_t getNativeHandle () const noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD screen_window_t getNativeHandle () noexcept
 Provides access to stored handle.
 
KZ_NO_DISCARD bool hasValue () const noexcept
 Checks if a handle is stored.
 
KZ_NO_DISCARD operator bool () const noexcept
 Conversion operator to bool.
 
KZ_NO_DISCARD screen_window_t && operator* () &&noexcept
 Provides access to stored handle via rvalue reference.
 
KZ_NO_DISCARD screen_window_t & operator* () &noexcept
 Provides access to stored handle via reference.
 
KZ_NO_DISCARD const screen_window_t && operator* () const &&noexcept
 Provides access to stored handle via const rvalue reference.
 
KZ_NO_DISCARD const screen_window_t & operator* () const &noexcept
 Provides access to stored handle via const reference.
 
OptionalHandleoperator= (const OptionalHandle &other)=delete
 Copy assignment operator.
 
OptionalHandleoperator= (const screen_window_t &value)
 Copy assignment operator.
 
OptionalHandleoperator= (OptionalHandle &&other) noexcept
 Move assignment operator.
 
OptionalHandleoperator= (screen_window_t &&value) noexcept
 Move assignment operator.
 
 OptionalHandle () noexcept
 Constructor.
 
 OptionalHandle (const OptionalHandle &other)=delete
 Copy constructor.
 
 OptionalHandle (const screen_window_t &nativeHandle) noexcept
 Constructor.
 
 OptionalHandle (OptionalHandle &&other) noexcept
 Move constructor.
 
screen_window_t release () noexcept
 Releases ownership of a native handle without destroying the resource.
 
void reset () noexcept
 Replaces stored handle with sentinel value.
 
void reset (U &&newHandle) noexcept
 Stores a new handle inside.
 
void swap (OptionalHandle &other)
 Swap function.
 
KZ_NO_DISCARD optional< screen_window_t > toOptional () &&noexcept
 Converts OptionalHandle to kanzi::optional.
 
 ~OptionalHandle ()
 Destructor.
 
- Protected Member Functions inherited from kanzi::qnx::QnxPropertyHost< QnxWindowMethods, KANZI_GENERATE_QNX_PROPERTY_HOST_SIGNATURE(window)>
KZ_NO_DISCARD optional< string > getPropertyCv (size_t stringBufferSize, int propertyName) const noexcept
 Gets QNX property consisting of a string.
 
KZ_NO_DISCARD optional< vector< int > > getPropertyIv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of ints.
 
KZ_NO_DISCARD optional< int > getPropertyIvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single int.
 
KZ_NO_DISCARD optional< vector< long long > > getPropertyLlv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of long longs.
 
KZ_NO_DISCARD optional< long long > getPropertyLlvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single long long.
 
KZ_NO_DISCARD optional< vector< T > > getPropertyPv (size_t returnValueCount, int propertyName) const noexcept
 Gets QNX property consisting of pointers.
 
KZ_NO_DISCARD optional< T > getPropertyPvSingle (int propertyName) const noexcept
 Gets a QNX property consisting of a single pointer.
 
bool setPropertyCv (int propertyName, string_view propertyValue) const noexcept
 Sets QNX property consisting of a string.
 
bool setPropertyIv (int propertyName, int propertyValue) const noexcept
 Sets QNX property consisting of a single int.
 
bool setPropertyIv (int propertyName, span< int > propertyValue) const noexcept
 Sets QNX property consisting of ints.
 
bool setPropertyLlv (int propertyName, long long propertyValue) const noexcept
 Sets QNX property consisting of a single long long.
 
bool setPropertyLlv (int propertyName, span< long long > propertyValue) const noexcept
 Sets QNX property consisting of long longs.
 
bool setPropertyPv (int propertyName, span< void * > propertyValue) const noexcept
 Sets QNX property consisting of pointers.
 
bool setPropertyPv (int propertyName, void *propertyValue) const noexcept
 Sets QNX property consisting of a single pointer.
 

Static Protected Member Functions

static KZ_NO_DISCARD QnxWindowMethods create (const QnxContext &qnxContext) noexcept
 Tries to create a QNX window.
 
static KZ_NO_DISCARD QnxWindowMethods create (QnxContext &qnxContext, const QnxDisplay &qnxDisplay, const QnxWindowProperties &properties) noexcept
 Tries to create a QNX window.
 
- Static Protected Member Functions inherited from kanzi::OptionalHandle< screen_window_t, nullptr, screen_destroy_window >
static constexpr auto getDeleter () noexcept
 Gets deleter function.
 
static constexpr screen_window_t getSentinel () noexcept
 Gets sentinel value that can be used to represent invalid handle.
 

Additional Inherited Members

- Protected Types inherited from kanzi::OptionalHandle< screen_window_t, nullptr, screen_destroy_window >
using HandleType
 Alias for this handle type.
 
using NativeHandleType
 Alias for the underlying native handle type.
 
- Protected Attributes inherited from kanzi::OptionalHandle< screen_window_t, nullptr, screen_destroy_window >
FlatOptional< screen_window_t, sentinel > m_handle
 Native handle that is managed by this class.
 

Detailed Description

Class representing QNX window methods.

Note
Do not use this class directly. Use QnxWindow instead.
See also
QnxWindow
Since
Kanzi 4.0.0 changed to use QnxPropertyHost interface.
Kanzi 4.0.0 inherits from OptionalHandle.
Kanzi 4.0.0 QnxWindow is now a safe wrapper around QnxWindowMethods.

Constructor & Destructor Documentation

◆ QnxWindowMethods() [1/2]

kanzi::qnx::QnxWindowMethods::QnxWindowMethods ( )
explicitprotecteddefaultnoexcept

Constructor.

◆ QnxWindowMethods() [2/2]

kanzi::qnx::QnxWindowMethods::QnxWindowMethods ( const NativeHandleType & handle)
explicitprotectednoexcept

Constructor.

Parameters
handleNative handle.

Member Function Documentation

◆ createBuffers()

bool kanzi::qnx::QnxWindowMethods::createBuffers ( int bufferCount) const
noexcept

Creates buffers for this window.

Parameters
bufferCountAmount of buffers to create.
Returns
True on success, false on failure.

◆ setBufferSize()

bool kanzi::qnx::QnxWindowMethods::setBufferSize ( windowing::Size bufferSize) const
noexcept

Sets buffer size for this window.

Parameters
bufferSizeBuffer size to set in pixels.
Returns
True on success, false on failure.

◆ getBufferSize()

KZ_NO_DISCARD optional< windowing::Size > kanzi::qnx::QnxWindowMethods::getBufferSize ( ) const
noexcept

Tries to get the buffer size for this window.

Return values
nulloptGetting the buffer size failed.
Returns
Buffer size in pixels.

◆ setUsageFlags()

bool kanzi::qnx::QnxWindowMethods::setUsageFlags ( int usageFlags) const
noexcept

Sets usage flags for this window.

Parameters
usageFlagsUsage flag bit mask to use.
Returns
True on success, false on failure.

◆ getUsageFlags()

KZ_NO_DISCARD optional< int > kanzi::qnx::QnxWindowMethods::getUsageFlags ( ) const
noexcept

Gets usage flags for this window.

Return values
nulloptFailed to get usage flags.
Returns
Usage flags.
Since
Kanzi 4.0.0 changed to return the value instead of using an out parameter.
Kanzi 4.0.0 marked with KZ_NO_DISCARD.

◆ setZOrder()

bool kanzi::qnx::QnxWindowMethods::setZOrder ( int zorder) const
noexcept

Sets z-order for this window.

Parameters
zorderZ order to set.
Returns
True on success, false on failure.

◆ show()

bool kanzi::qnx::QnxWindowMethods::show ( ) const
noexcept

Shows this window.

Returns
True on success, false on failure.

◆ hide()

bool kanzi::qnx::QnxWindowMethods::hide ( ) const
noexcept

Hides this window.

Returns
True on success, false on failure.

◆ setSize()

bool kanzi::qnx::QnxWindowMethods::setSize ( windowing::Size windowSize) const
noexcept

Sets size for this window.

Parameters
windowSizeWindow size to set in pixels.
Returns
True on success, false on failure.

◆ setPosition()

bool kanzi::qnx::QnxWindowMethods::setPosition ( windowing::Position windowPosition) const
noexcept

Sets position for this window.

Child window and embedded window positions are relative to their parent window positions.

Parameters
windowPositionWindow position to set in pixels.
Returns
True on success, false on failure.

◆ setTransparency()

bool kanzi::qnx::QnxWindowMethods::setTransparency ( int level) const
noexcept

Sets transparency level for this window.

Parameters
levelScreen transparency level to set.
Returns
True on success, false on failure.

◆ getSize()

KZ_NO_DISCARD optional< windowing::Size > kanzi::qnx::QnxWindowMethods::getSize ( ) const
noexcept

Tries to get the size for this window.

Return values
nulloptGetting the size failed.
Returns
Window size in pixels.
Since
Kanzi 4.0.0 renamed from tryGetSize.

◆ getPosition()

KZ_NO_DISCARD optional< windowing::Position > kanzi::qnx::QnxWindowMethods::getPosition ( ) const
noexcept

Tries to get the x and y screen coordinates for this window.

Return values
nulloptGetting the position failed.
Returns
Window position.
Since
Kanzi 4.0.0 renamed from tryGetPosition.

◆ setPropertyUserHandle()

bool kanzi::qnx::QnxWindowMethods::setPropertyUserHandle ( void * userHandle) const
noexcept

Sets user data for this window.

Parameters
userHandleUser data to set.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 renamed from trySetPropertyUserHandle.

◆ getPropertyUserHandle()

KZ_NO_DISCARD optional< void * > kanzi::qnx::QnxWindowMethods::getPropertyUserHandle ( ) const
noexcept

Gets user data for this window.

Return values
nulloptGetting user data failed.
Returns
User data pointer.
Since
Kanzi 4.0.0 renamed from tryGetPropertyUserHandle.

◆ getPropertyIDString()

KZ_NO_DISCARD optional< string > kanzi::qnx::QnxWindowMethods::getPropertyIDString ( unsigned int bufferSize) const
noexcept

Tries to get the current ID string for this window.

Parameters
bufferSizeMaximum buffer size for property ID string.
Return values
nulloptGetting the property ID string failed.
Returns
ID string, clamped to bufferSize.
Since
Kanzi 4.0.0 renamed from tryGetPropertyIDString.

◆ setPropertyIDString()

bool kanzi::qnx::QnxWindowMethods::setPropertyIDString ( string_view propertyString) const
noexcept

Sets a property ID string for this window.

Parameters
propertyStringProperty name to set.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 renamed from trySetPropertyIDString.

◆ setPropertyDisplay()

bool kanzi::qnx::QnxWindowMethods::setPropertyDisplay ( const QnxDisplay & qnxDisplay) const
noexcept

Sets display property for this window.

Parameters
qnxDisplayQNX display to use.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 renamed from trySetPropertyDisplay.

◆ setFormat()

bool kanzi::qnx::QnxWindowMethods::setFormat ( int format) const
noexcept

Sets pixel format property for this window.

Parameters
formatPixel format to set. Must be one of the formats defined in screen.h.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0

◆ setPipelineID()

bool kanzi::qnx::QnxWindowMethods::setPipelineID ( int id) const
noexcept

Sets screen pipeline ID for this window.

Note
Whenever pipeline ID is set manually, SCREEN_USAGE_OVERLAY flag must also be set in SCREEN_PROPERTY_USAGE. Non-member function setWindowPipelineID does this in addition to setting the pipeline ID. Use it instead if unsure.
Parameters
idScreen pipeline id to set.
Returns
True on success, false on failure.

◆ setSwapInterval()

bool kanzi::qnx::QnxWindowMethods::setSwapInterval ( int interval) const
noexcept

Sets minimum number of displayed video frames before a buffer swap for this window.

Parameters
intervalMinimum number of video frames to wait before buffer swap.
Returns
True on success, false on failure.

◆ createWindowGroup()

bool kanzi::qnx::QnxWindowMethods::createWindowGroup ( string_view windowGroupName) const
noexcept

Creates a window group with the specified name.

The window group name must be unique within the system and must not start with "__scrn-". If the specified window group name is the empty string, a name starting with "__scrn-" will be generated instead.

Parameters
windowGroupNameThe name of the window group to create.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0

◆ joinWindowGroup()

bool kanzi::qnx::QnxWindowMethods::joinWindowGroup ( string_view windowGroupName) const
noexcept

Joins a window group with the specified name.

Parameters
windowGroupNameThe name of the window group to join.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0

◆ leaveWindowGroup()

bool kanzi::qnx::QnxWindowMethods::leaveWindowGroup ( ) const
noexcept

Leaves a window group.

Returns
True on success, false on failure.
Since
Kanzi 4.0.0

◆ getWindowGroupName()

KZ_NO_DISCARD optional< string > kanzi::qnx::QnxWindowMethods::getWindowGroupName ( ) const
noexcept

Gets the window group name.

Returns
Name of the window group.
Return values
nulloptWindow group name query failed.
Since
Kanzi 4.0.0

◆ setWindowPipelineID()

bool kanzi::qnx::QnxWindowMethods::setWindowPipelineID ( int id) const
noexcept

Sets pipeline ID for window.

Sets also SCREEN_USAGE_OVERLAY usage flag.

Parameters
idValue for pipeline ID.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 Moved from being a free function.

◆ getWindowSizeU()

KZ_NO_DISCARD optional< windowing::SizeU > kanzi::qnx::QnxWindowMethods::getWindowSizeU ( ) const
noexcept

Tries to get window size in unsigned format.

Return values
nulloptGetting the size failed.
Returns
Window size in pixels.
Since
Kanzi 4.0.0 renamed from tryGetWindowSizeU.
Kanzi 4.0.0 Moved from being a free function.

◆ setWindowTitle()

bool kanzi::qnx::QnxWindowMethods::setWindowTitle ( string_view windowTitle) const
noexcept

Sets a window title.

Parameters
windowTitleWindow title to set.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 Moved from being a free function.

◆ getWindowTitle()

KZ_NO_DISCARD optional< string > kanzi::qnx::QnxWindowMethods::getWindowTitle ( ) const
noexcept

Tries to get the window title.

Return values
nulloptGetting the title failed.
Returns
True on success, false on failure.
Since
Kanzi 4.0.0 renamed from tryGetWindowTitle.
Kanzi 4.0.0 Moved from being a free function.

◆ bringToFront()

bool kanzi::qnx::QnxWindowMethods::bringToFront ( ) const
noexcept

Brings the window to forefront.

Returns
True on success, false on failure.
Since
Kanzi 4.0.0 Moved from being a free function.

◆ create() [1/2]

static KZ_NO_DISCARD QnxWindowMethods kanzi::qnx::QnxWindowMethods::create ( QnxContext & qnxContext,
const QnxDisplay & qnxDisplay,
const QnxWindowProperties & properties )
staticprotectednoexcept

Tries to create a QNX window.

Parameters
qnxContextQNX context.
qnxDisplayQNX display.
propertiesQNX window properties used to construct QnxWindow.
Returns
The created object. If error occurred, empty.
See also
QnxWindowProperties
Since
Kanzi 4.0.0 returns a QnxWindow and changed to accept QnxWindowProperties.
Kanzi 4.0.0 renamed from tryCreate.

◆ create() [2/2]

static KZ_NO_DISCARD QnxWindowMethods kanzi::qnx::QnxWindowMethods::create ( const QnxContext & qnxContext)
staticprotectednoexcept

Tries to create a QNX window.

Parameters
qnxContextQNX context.
Returns
The created object. If error occurred, empty.
Since
Kanzi 4.0.0

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