Zakero's C++ Header Libraries
A collection of reusable C++ libraries
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
zakero::Xenium Class Reference

A wrapper class for X11/XCB. More...

Classes

struct  Key
 Key event information. More...
 
struct  KeyModifier
 A collection modifier flags. More...
 
struct  Output
 Information about a output device. More...
 
struct  PointerAxis
 Information about an Axis event. More...
 
struct  PointerButton
 Information about a pointer button event. More...
 
struct  PointMm
 A location that uses millimeters. More...
 
struct  PointPercent
 A location that uses percentages. More...
 
struct  PointPixel
 A location that uses pixels. More...
 
struct  SizeMm
 Size measured in millimeters. More...
 
struct  SizePercent
 Size measured as a percentage of the Output (Monitor) resolution. More...
 
struct  SizePixel
 Size measured in pixels. More...
 
class  Window
 A Window. More...
 

Public Types

enum class  KeyState
 Keyboard key state More...
 
enum class  PointerAxisSource
 Where the axis information came from.
 
enum class  PointerAxisType
 The direction of the axis movement.
 
enum class  PointerButtonState
 Mouse button state.
 
enum class  WindowDecorations
 Who is responsible for rendering the decorations.
 
using WindowId = uint32_t
 A type for better readablity.
 
enum class  WindowMode
 All the available window modes.
 

Public Member Functions

virtual ~Xenium () noexcept
 Destructor. More...
 
int32_t keyRepeatDelay () const noexcept
 The key repeat delay. More...
 
int32_t keyRepeatRate () const noexcept
 The key repeat rate. More...
 
Xenium::Output output (const Xenium::OutputId) const noexcept
 Get a copy of the Output information. More...
 
Xenium::PointMm outputConvertToMm (const Xenium::OutputId, const Xenium::PointPixel &) const noexcept
 Convert Pixel to Millimeter. More...
 
Xenium::SizeMm outputConvertToMm (const Xenium::OutputId, const Xenium::SizePixel &) const noexcept
 Convert Pixel to Millimeter. More...
 
Xenium::PointPercent outputConvertToPercent (const Xenium::OutputId, const Xenium::PointPixel &) const noexcept
 Convert Pixel to a Percentage. More...
 
Xenium::SizePercent outputConvertToPercent (const Xenium::OutputId, const Xenium::SizePixel &) const noexcept
 Convert Pixel to a Percentage. More...
 
Xenium::PointPixel outputConvertToPixel (const Xenium::OutputId, const Xenium::PointMm &) const noexcept
 Convert Millimeter to Pixel. More...
 
Xenium::PointPixel outputConvertToPixel (const Xenium::OutputId, const Xenium::PointPercent &) const noexcept
 Convert Percentage to Pixel. More...
 
Xenium::SizePixel outputConvertToPixel (const Xenium::OutputId, const Xenium::SizeMm &) const noexcept
 Convert Millimeter to Pixel. More...
 
Xenium::SizePixel outputConvertToPixel (const Xenium::OutputId, const Xenium::SizePercent &) const noexcept
 Convert Percentage to Pixel. More...
 
void outputOnAdd (Xenium::LambdaOutputId) noexcept
 Notification of adding an Output device. More...
 
void outputOnChange (Xenium::LambdaOutputId) noexcept
 Notification that an Output device has changed. More...
 
void outputOnRemove (Xenium::LambdaOutputId) noexcept
 Notification of removing an Output device. More...
 
Xenium::VectorOutputId outputVector () const noexcept
 Get a list of the Output Id's. More...
 
Xenium::WindowwindowCreate (const Xenium::SizeMm &, const uint32_t, xcb_create_window_value_list_t &, std::error_code &) noexcept
 Create a window. More...
 
Xenium::WindowwindowCreate (const Xenium::SizeMm &, std::error_code &) noexcept
 Create a window. More...
 
Xenium::WindowwindowCreate (const Xenium::SizePercent &, const uint32_t, xcb_create_window_value_list_t &, std::error_code &) noexcept
 Create a window. More...
 
Xenium::WindowwindowCreate (const Xenium::SizePercent &, std::error_code &) noexcept
 Create a window. More...
 
Xenium::WindowwindowCreate (const Xenium::SizePixel &, const uint32_t, xcb_create_window_value_list_t &, std::error_code &) noexcept
 Create a window. More...
 
Xenium::WindowwindowCreate (const Xenium::SizePixel &, std::error_code &) noexcept
 Create a window. More...
 

Static Public Member Functions

static Xeniumconnect () noexcept
 Establish a connection with the X11 server. More...
 
static Xeniumconnect (const std::string &) noexcept
 Establish a connection with the X11 server. More...
 
static Xeniumconnect (const std::string &, std::error_code &) noexcept
 Establish a connection with the X11 server. More...
 
static Xeniumconnect (std::error_code &) noexcept
 Establish a connection with the X11 server. More...
 
static std::string outputSubpixelName (int32_t) noexcept
 Get a human readable string. More...
 
static std::string outputTransformName (int32_t) noexcept
 Get a human readable string. More...
 

Lambdas

using Lambda = std::function< void()>
 A Lambda that has no parameters.
 
using LambdaAxis = std::function< void(const Xenium::PointerAxis &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointerAxis and KeyModifier.
 
using LambdaBool = std::function< void(bool)>
 A Lambda that has a parameter: bool.
 
using LambdaButtonMm = std::function< void(const Xenium::PointerButton &, const Xenium::PointMm &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointerButton, PointMm and KeyModifier.
 
using LambdaButtonPercent = std::function< void(const Xenium::PointerButton &, const Xenium::PointPercent &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointerButton, PointPercent and KeyModifier.
 
using LambdaButtonPixel = std::function< void(const Xenium::PointerButton &, const Xenium::PointPixel &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointerButton, PointPixel and KeyModifier.
 
using LambdaKey = std::function< void(const Xenium::Key &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: Key and KeyModifier.
 
using LambdaPointMm = std::function< void(const Xenium::PointMm &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointMm and KeyModifier.
 
using LambdaPointPercent = std::function< void(const Xenium::PointPercent &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointPercent and KeyModifier.
 
using LambdaPointPixel = std::function< void(const Xenium::PointPixel &, const Xenium::KeyModifier &)>
 A Lambda that has parameters: PointPixel and KeyModifier.
 
using LambdaSizeMm = std::function< void(const Xenium::SizeMm &)>
 A Lambda that has a parameter: SizeMm.
 
using LambdaSizePercent = std::function< void(const Xenium::SizePercent &)>
 A Lambda that has a parameter: SizePercent.
 
using LambdaSizePixel = std::function< void(const Xenium::SizePixel &)>
 A Lambda that has a parameter: SizePixel.
 
using LambdaWindowDecorations = std::function< void(Xenium::WindowDecorations)>
 A Lambda that has a parameter: WindowDecorations.
 
using LambdaWindowMode = std::function< void(Xenium::WindowMode)>
 A Lambda that has a parameter: WindowMode.
 

Key Modifier Flags

static constexpr uint32_t KeyModifier_Shift
 Key Modifier flag.
 
static constexpr uint32_t KeyModifier_CapsLock
 Key Modifier flag.
 
static constexpr uint32_t KeyModifier_Control
 Key Modifier flag.
 
static constexpr uint32_t KeyModifier_Alt
 Key Modifier flag.
 
static constexpr uint32_t KeyModifier_NumLock
 Key Modifier flag.
 
static constexpr uint32_t KeyModifier_Meta
 Key Modifier flag.
 

Detailed Description

Refer to Zakero_Xenium.h to learn how to include this library.

The intent of this class is to make creating programs that interface directly with X11 easier. While there are toolkits out there that do this (GTK, Qt, SDL, etc.), they also come with a lot of overhead. This class will abstract much of X11 and provide a simple event driven interface.

As soon as a connection to the X11 server has been established, a thread will be created to move all the communications to the background. This means that there is no "main loop" in the Xenium object to hook into. The benefit to this is that Window contents/graphics will not block event handling.

Refer to How To Use It? for a simple example.

Window

Using Xenium to connect to a X11 server is just the first step. The next step is to create a Window that can display something. This is done using one of the windowCreate() methods. There are 3 sets of methods:

Why three? The traditional pixels for size has many problems in today's display technology. A resolution of 1024x768 may sound consistent in that you know exactly how many pixels will be used on every display. However, 1024x768 may be OK on some displays, it may be too small on 4k laptop screens. And what about the 8k displays?

The easy answer is to find the maximum resolution and use all of it, or just half for a windowed app. Instead of doing that work, why not just use percentages like 1.00x1.00 or 0.50x0.50 that will work on all display resolutions? That is why Xenium has the SizePercent object.

What about millimeters? Using millimeters gives the developer more confidence that size of an area will be physically consistent across devices. To illustrate this consider defining a 300x150 button. This button may be easily clickable on most monitors but may be too small on a 4k display. Defining a button to be 20mm x 10mm, it will be the same physical size on all monitors.

What's wrong with using DPI?
DPI has become a mess in the computer world and it is resolution, not a size.

Multi-Threaded Considerations
The main X11 event loop runs in a dedicated thread. While all the X11 communication is not hindering the application, keep in mind that all event lambdas will be executed by Xenium's internal event loop. This means two things:
  • Lambdas that execute for a "long" time will slow down the event loop.
    So keep lambdas a simple and as short as possible.
  • If the application depends on a value that is updated by an event lambda, that value can change at any time. Consider making a copy of the value before using it.
Code Structure

Looking at the code for Xenium, you will quickly see that it does not follow traditional Object Oriented design. Instead of having all the XCB data and functions in the Window class, everything is in the Xenium class and the Window only has an ID that is passed to the Xenium class. Yes, this is Data Oriented design. Using Data Oriented design for Xenium has the following benefits:

Threading
Thread execution does not cross object boundaries. This helps maintain a cleaner mental model of "which thread is doing what".

C++ Access Restrictions
Having Window as a inner class of Xenium allows the Window to be able to access Xenium's private members. However, Xenium does not have access to any of Window's private members. Using this access structure, both Xenium and a Window can use the event lambdas. If Window was not an inner class, then one or both of Xenium and Window would have to be friends. (friend by-passes C++ access restrictions, not good)

Performance
Yes, it had to be mentioned. The core of Xenium is the XCB event loop. If the event loop had to load the entire contents of a window just to access a small handful of data for each event, there would a performance hit. With the current design, each event will only load the data it needs. Much faster.


Class Documentation

◆ zakero::Xenium::Key

struct zakero::Xenium::Key

Time is based on the "steady clock" and not system time.

Class Members
uint32_t code The key code of the event.
KeyState state The state of the key.
uint32_t time When the key event happened.

◆ zakero::Xenium::KeyModifier

struct zakero::Xenium::KeyModifier

The meaning of the modifiers are:

  • pressed
    This is the easiest to understand type of modifier. A modifier such as "Control" is pressed.
  • locked
    The best example of a "locked" modifier is the "Caps Lock" key.
  • latched
    This modifer can occur with "Sticky Keys".
Class Members
uint32_t group The keyboard layout.
uint32_t latched A collection of latched modifiers.
uint32_t locked A collection of locked modifiers.
uint32_t pressed A collection of pressed modifiers.

◆ zakero::Xenium::Output

struct zakero::Xenium::Output

All the X11 information about an output device in a single structure.

Class Members
int32_t height The height of the device in hardware units.
string name The name of the output.
uint32_t physical_height_mm The height of the device in millimeters.
uint32_t physical_width_mm The width of the device in millimeters.
float pixels_per_mm_horizontal A pre-calculated value.
float pixels_per_mm_vertical A pre-calculated value.
int32_t subpixel The device's subpixel orientation.
int32_t transform Transform that maps framebuffer to output.
int32_t width The width of the device in hardware units.
int32_t x The X position within the global compositor.
int32_t y The Y position within the global compositor.

◆ zakero::Xenium::PointerAxis

struct zakero::Xenium::PointerAxis
Class Members
float distance The distance traveled.
PointerAxisSource source The source of the event.
int32_t steps The number of rotation steps.
uint32_t time When the event occurred.
PointerAxisType type The type of Axis.

◆ zakero::Xenium::PointerButton

struct zakero::Xenium::PointerButton
Class Members
uint32_t code The event code.
PointerButtonState state The button state.

Member Enumeration Documentation

◆ KeyState

When using a keyboard, a key will emit one of these states.

Constructor & Destructor Documentation

◆ ~Xenium()

zakero::Xenium::~Xenium ( )
virtualnoexcept

Deleting the Xenium object will automatically disconnect from the X11 server.

Because Xenium is multithreaded, this method will block until all connections to X11 have been closed.

Member Function Documentation

◆ connect() [1/4]

Xenium * zakero::Xenium::connect ( )
staticnoexcept

Establish a connection with the X11 server. The following values will be used to determine which X11 server to connect to:

  1. DISPLAY
    Use the value of this environment variable.
  2. nullptr
    The X11 defined default.

If a connection was successful, then a pointer to a new Xenium instance will be returned. This pointer will need to be deleted by the caller. If there was an error connecting to the X11 server, nullptr will be returned.

Note
A connection to the X11 server must be made before any windows are created.
Returns
A pointer to a Xenium instance or a nullptr if there was an error.

◆ connect() [2/4]

Xenium * zakero::Xenium::connect ( const std::string &  display)
staticnoexcept

Establish a connection with the X11 server using the provided display name. If the display name is empty then the following values will be used to determine which X11 server to connect to:

  1. DISPLAY
    Use the value of this environment variable.
  2. nullptr
    The X11 defined default.

If a connection was successful, then a pointer to a new Xenium instance will be returned. This pointer will need to be deleted by the caller. If there was an error connecting to the X11 server, nullptr will be returned.

Note
A connection to the X11 server must be made before any windows are created.
Returns
A pointer to a Xenium instance or a nullptr if there was an error.
Parameters
displayThe Display Name or ID

◆ connect() [3/4]

Xenium * zakero::Xenium::connect ( const std::string &  display,
std::error_code &  error 
)
staticnoexcept

Establish a connection with the X11 server using the provided display name. If the display name is empty then the following values will be used to determine which X11 server to connect to:

  1. DISPLAY
    Use the value of this environment variable.
  2. nullptr
    The X11 defined default.

If a connection was successful, then a pointer to a new Xenium instance will be returned. This pointer will need to be deleted by the caller. If there was an error connecting to the X11 server, nullptr will be returned.

The provided error will be set to Xenium::Error_None or the reason for the connection failure. An error code of Xenium::Error_Connection_Failed or Xenium::Error_Invalid_Display_Name may indicate that there is no X11 server available.

Note
A connection to the X11 server must be made before any windows are created.
Returns
A pointer to a Xenium instance or a nullptr if there was an error.
Parameters
displayThe Display Name or ID
errorThe error status

◆ connect() [4/4]

Xenium * zakero::Xenium::connect ( std::error_code &  error)
staticnoexcept

Establish a connection with the X11 server. The following values will be used to determine which X11 server to connect to:

  1. DISPLAY
    Use the value of this environment variable.
  2. nullptr
    The X11 defined default.

If a connection was successful, then a pointer to a new Xenium instance will be returned. This pointer will need to be deleted by the caller. If there was an error connecting to the X11 server, nullptr will be returned.

The provided error will be set to Xenium::Error_None or the reason for the connection failure. An error code of Xenium::Error_Connection_Failed or Xenium::Error_Invalid_Display_Name may indicate that there is no X11 server available.

Note
A connection to the X11 server must be made before any windows are created.
Returns
A pointer to a Xenium instance or a nullptr if there was an error.
Parameters
errorThe error code

◆ keyRepeatDelay()

int32_t zakero::Xenium::keyRepeatDelay ( ) const
noexcept

The key repeat delay is the amount of time in milliseconds that must elapse from a key press event to change into a key repeat event.

Returns
The key repeat delay.

◆ keyRepeatRate()

int32_t zakero::Xenium::keyRepeatRate ( ) const
noexcept

The key repeat rate is the number of key repeat events that will be emitted per second.

Returns
The key repeat rate.

◆ output()

Xenium::Output zakero::Xenium::output ( const Xenium::OutputId  output_id) const
noexcept

All the available information about an output device will be provided. It is possible that an output device is removed after the data has been retrieved, so consider the provided data as a "snapshot in time".

If the provided output_id is not valid, then the returned data will be empty.

Returns
The Output data.
Parameters
output_idThe Output Id

◆ outputConvertToMm() [1/2]

Xenium::PointMm zakero::Xenium::outputConvertToMm ( const Xenium::OutputId  output_id,
const Xenium::PointPixel point 
) const
noexcept

Convert a pixel-based point location to millimeters using the provided output_id.

Returns
A point that uses millimeters.
Parameters
output_idThe output device for the conversion
pointThe point to convert

◆ outputConvertToMm() [2/2]

Xenium::SizeMm zakero::Xenium::outputConvertToMm ( const Xenium::OutputId  output_id,
const Xenium::SizePixel size 
) const
noexcept

Convert a pixel-based size to millimeters using the provided output_id.

Returns
A size that uses millimeters.
Parameters
output_idThe output device for the conversion
sizeThe size to convert

◆ outputConvertToPercent() [1/2]

Xenium::PointPercent zakero::Xenium::outputConvertToPercent ( const Xenium::OutputId  output_id,
const Xenium::PointPixel point 
) const
noexcept

Convert a pixel-based point location to a percentage using the provided output_id.

Returns
A point that uses a percentage.
Parameters
output_idThe output device for the conversion
pointThe point to convert

◆ outputConvertToPercent() [2/2]

Xenium::SizePercent zakero::Xenium::outputConvertToPercent ( const Xenium::OutputId  output_id,
const Xenium::SizePixel size 
) const
noexcept

Convert a pixel-based size to a percentage using the provided output_id.

Returns
A size that uses a percentage.
Parameters
output_idThe output device for the conversion
sizeThe size to convert

◆ outputConvertToPixel() [1/4]

Xenium::PointPixel zakero::Xenium::outputConvertToPixel ( const Xenium::OutputId  output_id,
const Xenium::PointMm point 
) const
noexcept

Convert a millimeter-based point location to pixel using the provided output_id.

Returns
A point that uses pixels.
Parameters
output_idThe output device for the conversion
pointThe point to convert

◆ outputConvertToPixel() [2/4]

Xenium::PointPixel zakero::Xenium::outputConvertToPixel ( const Xenium::OutputId  output_id,
const Xenium::PointPercent point 
) const
noexcept

Convert a percentage-based point location to pixel using the provided output_id.

Returns
A point that uses pixels.
Parameters
output_idThe output device for the conversion
pointThe point to convert

◆ outputConvertToPixel() [3/4]

Xenium::SizePixel zakero::Xenium::outputConvertToPixel ( const Xenium::OutputId  output_id,
const Xenium::SizeMm size 
) const
noexcept

Convert a millimeter-based size to pixel using the provided output_id.

Returns
A size that uses pixels.
Parameters
output_idThe output device for the conversion
sizeThe size to convert

◆ outputConvertToPixel() [4/4]

Xenium::SizePixel zakero::Xenium::outputConvertToPixel ( const Xenium::OutputId  output_id,
const Xenium::SizePercent size 
) const
noexcept

Convert a percentage-based size to pixel using the provided output_id.

Returns
A size that uses pixels.
Parameters
output_idThe output device for the conversion
sizeThe size to convert

◆ outputOnAdd()

void zakero::Xenium::outputOnAdd ( Xenium::LambdaOutputId  lambda)
noexcept

When an output device has been added, the lambda that was provided to this method will be called. To disable these notifications, pass nullptr as the value of lambda.

Parameters
lambdaThe lambda to call

◆ outputOnChange()

void zakero::Xenium::outputOnChange ( Xenium::LambdaOutputId  lambda)
noexcept

When an output device's configuration has been changed, the lambda that was provided to this method will be called. To disable these notifications, pass nullptr as the value of lambda.

Parameters
lambdaThe lambda to call

◆ outputOnRemove()

void zakero::Xenium::outputOnRemove ( Xenium::LambdaOutputId  lambda)
noexcept

When an output device has been removed, the lambda that was provided to this method will be called. To disable these notifications, pass nullptr as the value of lambda.

Parameters
lambdaThe lambda to call

◆ outputSubpixelName()

std::string zakero::Xenium::outputSubpixelName ( int32_t  subpixel_format)
staticnoexcept

The Xenium::Output::subpixel is an XCB enum value and this method will convert that value into a descriptive name string. If an invalid value is passed, then an empty string will be returned.

Returns
The name of the subpixel format.
Parameters
subpixel_formatThe Subpixel format

◆ outputTransformName()

std::string zakero::Xenium::outputTransformName ( int32_t  transform)
staticnoexcept

The Xenium::Output::transform is an XCB RandR enum value and this method will convert that value into a descriptive name string. If an invalid value is passed, then an empty string will be returned.

Returns
The name of the transform.
Parameters
transformThe Transform

◆ outputVector()

Xenium::VectorOutputId zakero::Xenium::outputVector ( ) const
noexcept

All the Output IDs will be returned. It is possible that an output device is removed after the data has been retrieved, so consider the provided data as a "snapshot in time".

Returns
The Output Id's.

◆ windowCreate() [1/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizeMm size_mm,
const uint32_t  value_mask,
xcb_create_window_value_list_t &  value_list,
std::error_code &  error 
)
noexcept

Create a new Window with the specified size and values. The value_mask and value_list work together. The value_list is a collection of values that will be applied to the Window. The value_mask bit field determines which values will be used in the value_list.

The error parameter will be set to Error_None if the window was successfully created or it will be set to an appropriate error code.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. For Xenium, the smallest possible window size is Window_Size_Minimum pixels after millimeter conversion.
Returns
A pointer to the new Window or nullptr on error.
Parameters
size_mmThe window size
value_maskThe value mask
value_listThe value list
errorThe error state

◆ windowCreate() [2/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizeMm size,
std::error_code &  error 
)
noexcept

Create a new Window with the specified size. A pointer to the Window will be returned. If there was a problem, a nullptr will returned.

The error parameter will be set to Xenium::Error_None on success or to an appropriate error if there was a problem.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. The recommended minimum size is 10 millimeters.
Returns
A pointer to the new Window or nullptr on error.
Parameters
sizeThe window size
errorThe error state

◆ windowCreate() [3/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizePercent size_percent,
const uint32_t  value_mask,
xcb_create_window_value_list_t &  value_list,
std::error_code &  error 
)
noexcept

Create a new Window with the specified size and values. The value_mask and value_list work together. The value_list is a collection of values that will be applied to the Window. The value_mask bit field determines which values will be used in the value_list.

The error parameter will be set to Error_None if the window was successfully created or it will be set to an appropriate error code.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. For Xenium, the smallest possible window size is Window_Size_Minimum pixels.
Returns
A pointer to the new Window or nullptr on error.
Parameters
size_percentThe window size
value_maskThe value mask
value_listThe value list
errorThe error state

◆ windowCreate() [4/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizePercent size,
std::error_code &  error 
)
noexcept

Create a new Window of the specified size. A pointer to the Window will be returned. If there was a problem, a nullptr will returned.

The error parameter will be set to Xenium::Error_None on success or to an appropriate error if there was a problem.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. For Xenium, the smallest possible window size is Window_Size_Minimum pixels after percentage conversion.
Returns
A pointer to the new Window or nullptr on error.
Parameters
sizeThe window size
errorThe error state

◆ windowCreate() [5/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizePixel size_pixel,
const uint32_t  value_mask,
xcb_create_window_value_list_t &  value_list,
std::error_code &  error 
)
noexcept

Create a new Window with the specified size and values. The value_mask and value_list work together. The value_list is a collection of values that will be applied to the Window. The value_mask bit field determines which values will be used in the value_list.

The error parameter will be set to Error_None if the window was successfully created or it will be set to an appropriate error code.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. The recommended minimum size is 100 pixels.
Returns
A pointer to the new Window or nullptr on error.
Parameters
size_pixelThe window size
value_maskThe value mask
value_listThe value list
errorThe error state

◆ windowCreate() [6/6]

Xenium::Window * zakero::Xenium::windowCreate ( const Xenium::SizePixel size,
std::error_code &  error 
)
noexcept

Create a new Window of the specified size. A pointer to the Window will be returned. If there was a problem, a nullptr will returned.

The error parameter will be set to Xenium::Error_None on success or to an appropriate error if there was a problem.

Note
The size of a window must be greater than 0. Also some X11 Servers may have further size restrictions. The recommended minimum size is 100 pixels.
Returns
A pointer to the new Window or nullptr on error.
Parameters
sizeThe window size
errorThe error state

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