Kanzi  3.9.8
Kanzi Engine C++ API
kanzi::x11::X11Display Class Reference

An X11 display. More...

#include <kanzi/core.ui/platform/windowing_ng/x11/x11_display.hpp>

Public Member Functions

KZ_NO_DISCARD int getConnectionNumber () const noexcept
 Gets the connection number. More...
 
KZ_NO_DISCARD Window getDefaultRootWindow () const noexcept
 Gets the default root window handle. More...
 
KZ_NO_DISCARD int getDefaultScreen () const noexcept
 Gets the default screen handle. More...
 
KZ_NO_DISCARD int getEventCount () const noexcept
 Gets the number of remaining X events. More...
 
KZ_NO_DISCARD Display * getNativeHandle () const noexcept
 Gets the native handle. More...
 
KZ_NO_DISCARD XEvent getNextEvent () noexcept
 Gets the next X event. More...
 
KZ_NO_DISCARD Atom internAtom (const char *atomName, bool onlyIfExists) const noexcept
 Interns an atom identified with a name. More...
 
template<int Size>
KZ_NO_DISCARD array< Atom, Size > internAtoms (const array< const char *, Size > &atomNames, bool onlyIfExists) const noexcept
 Interns atoms identified with names. More...
 
bool registerWindowExit (const X11Window &window) const noexcept
 Registers a window exit atom. More...
 
bool sendXEvent (const XEvent &xEvent, bool doPropagation, long eventMask) noexcept
 Sends an X event to the display server. More...
 
void syncEvents () noexcept
 Flushes the event buffer and waits until the display server finishes processing all events. More...
 
KZ_NO_DISCARD optional< windowing::PositiontryGetTranslatedPositionRelatedToOrigin (const X11Window &window, windowing::Position origin) const noexcept
 Tries to get the position of a window relative to an origin. More...
 
KZ_NO_DISCARD optional< XWindowAttributes > tryGetWindowAttributes (const X11Window &window) const noexcept
 Tries to get the window attributes. More...
 
 X11Display (const char *displayName)
 Constructor. More...
 
 X11Display (Display *displayHandle)
 Constructor. More...
 
 ~X11Display ()
 Destructor. More...
 

Detailed Description

An X11 display.

Since
Kanzi 3.9.8

Constructor & Destructor Documentation

kanzi::x11::X11Display::X11Display ( const char *  displayName)
explicit

Constructor.

Parameters
displayNameX11 display name.
kanzi::x11::X11Display::X11Display ( Display *  displayHandle)
explicit

Constructor.

Parameters
displayHandleX11 display handle.
kanzi::x11::X11Display::~X11Display ( )

Destructor.

Member Function Documentation

bool kanzi::x11::X11Display::registerWindowExit ( const X11Window window) const
noexcept

Registers a window exit atom.

Parameters
windowThe window for which to register the exit atom.
Returns
On success, true, otherwise false.
template<int Size>
KZ_NO_DISCARD array<Atom, Size> kanzi::x11::X11Display::internAtoms ( const array< const char *, Size > &  atomNames,
bool  onlyIfExists 
) const
inlinenoexcept

Interns atoms identified with names.

Parameters
atomNamesNames of the atoms to intern.
onlyIfExistsWhether to intern the atom if it already exists.
Returns
The interned atoms.
KZ_NO_DISCARD Atom kanzi::x11::X11Display::internAtom ( const char *  atomName,
bool  onlyIfExists 
) const
noexcept

Interns an atom identified with a name.

Parameters
atomNameName of the atom to intern.
onlyIfExistsWhether to intern the atom if it already exists.
Returns
The interned atom.
KZ_NO_DISCARD XEvent kanzi::x11::X11Display::getNextEvent ( )
noexcept

Gets the next X event.

Returns
The next X event.
KZ_NO_DISCARD int kanzi::x11::X11Display::getEventCount ( ) const
noexcept

Gets the number of remaining X events.

Returns
The X event count.
bool kanzi::x11::X11Display::sendXEvent ( const XEvent &  xEvent,
bool  doPropagation,
long  eventMask 
)
noexcept

Sends an X event to the display server.

Parameters
xEventX event to send.
doPropagationWhether to propagate the event to any ancestor client windows selecting on the mask bits.
eventMaskX event mask bits.
Returns
On success, true, otherwise false.
void kanzi::x11::X11Display::syncEvents ( )
noexcept

Flushes the event buffer and waits until the display server finishes processing all events.

KZ_NO_DISCARD Display* kanzi::x11::X11Display::getNativeHandle ( ) const
noexcept

Gets the native handle.

Returns
The native handle.
KZ_NO_DISCARD Window kanzi::x11::X11Display::getDefaultRootWindow ( ) const
noexcept

Gets the default root window handle.

Returns
The default root window handle.
KZ_NO_DISCARD int kanzi::x11::X11Display::getDefaultScreen ( ) const
noexcept

Gets the default screen handle.

Returns
The default screen handle.
KZ_NO_DISCARD int kanzi::x11::X11Display::getConnectionNumber ( ) const
noexcept

Gets the connection number.

Returns
The connection number.
KZ_NO_DISCARD optional<XWindowAttributes> kanzi::x11::X11Display::tryGetWindowAttributes ( const X11Window window) const
noexcept

Tries to get the window attributes.

Parameters
windowThe window for which to get the attributes.
Return values
nulloptGetting the window attributes failed.
Returns
The window attributes.
KZ_NO_DISCARD optional<windowing::Position> kanzi::x11::X11Display::tryGetTranslatedPositionRelatedToOrigin ( const X11Window window,
windowing::Position  origin 
) const
noexcept

Tries to get the position of a window relative to an origin.

Parameters
windowThe window whose position you want to get.
originThe origin relative to which you want to get the window position.
Return values
nulloptGetting the window position failed.
Returns
The position of the window relative to the origin.

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