|
bool | zakero::operator== (Xenium::PointMm &lhs, Xenium::PointMm &rhs) noexcept |
| Compare two Point objects. More...
|
|
bool | zakero::operator== (Xenium::PointPercent &lhs, Xenium::PointPercent &rhs) noexcept |
| Compare two Point objects. More...
|
|
bool | zakero::operator== (Xenium::PointPixel &lhs, Xenium::PointPixel &rhs) noexcept |
| Compare two Point objects. More...
|
|
bool | zakero::operator== (Xenium::SizeMm &lhs, Xenium::SizeMm &rhs) noexcept |
| Compare two Point objects. More...
|
|
bool | zakero::operator== (Xenium::SizePercent &lhs, Xenium::SizePercent &rhs) noexcept |
| Compare two Point objects. More...
|
|
bool | zakero::operator== (Xenium::SizePixel &lhs, Xenium::SizePixel &rhs) noexcept |
| Compare two Size objects. More...
|
|
std::string | zakero::to_string (const std::vector< int32_t > &vector) noexcept |
| Convert a vector into a string. More...
|
|
std::string | zakero::to_string (const std::vector< xcb_atom_t > &vector) noexcept |
| Convert a vector into a string. More...
|
|
std::string | zakero::to_string (const xcb_button_press_event_t &event) noexcept |
| Convert an xcb_button_press_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_client_message_event_t &event) noexcept |
| Convert an xcb_client_message_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_configure_notify_event_t &event) noexcept |
| Convert an xcb_configure_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_enter_notify_event_t &event) noexcept |
| Convert an xcb_enter_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_expose_event_t &event) noexcept |
| Convert an xcb_expose_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_focus_in_event_t &event) noexcept |
| Convert an xcb_focus_in_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_format_t &format) noexcept |
| Convert an xcb_format_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_generic_error_t &generic_error) noexcept |
| Convert an xcb_generic_error_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_generic_event_t &event) noexcept |
| Convert an xcb_generic_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_gravity_notify_event_t &event) noexcept |
| Convert an xcb_gravity_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_key_press_event_t &event) noexcept |
| Convert an xcb_key_press_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_map_notify_event_t &event) noexcept |
| Convert an xcb_map_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_motion_notify_event_t &event) noexcept |
| Convert an xcb_motion_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_property_notify_event_t &event) noexcept |
| Convert an xcb_property_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_randr_screen_change_notify_event_t &event) noexcept |
| Convert an xcb_randr_screen_change_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_reparent_notify_event_t &event) noexcept |
| Convert an xcb_reparent_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_screen_t &screen) noexcept |
| Convert an xcb_screen_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_setup_t &setup) noexcept |
| Convert an xcb_setup_t into a string. More...
|
|
std::string | zakero::to_string (const xcb_unmap_notify_event_t &event) noexcept |
| Convert an xcb_unmap_notify_event_t into a string. More...
|
|
std::string | zakero::to_string (const Xenium::Key &key) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::KeyModifier &key_modifier) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::KeyState key_state) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::Output &output) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointerAxis &pointer_axis) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointerAxisSource source) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointerAxisType type) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointerButton &button) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointerButtonState &button_state) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointMm point) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointPercent point) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::PointPixel point) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::SizeMm &size) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::SizePercent &size) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::SizePixel &size) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::WindowDecorations window_decorations) noexcept |
| Convert a value to a std::string. More...
|
|
std::string | zakero::to_string (const Xenium::WindowMode window_mode) noexcept |
| Convert a value to a std::string. More...
|
|
Making the X11/XCB windowing system easy to use.
- Dependencies
-
- TL;DR:
This library makes it very easy to connect to an X11 server and display windows. The developer must write pixel data directly into the window. No UI or graphics functionality is provided.
To use:
- Add the implementation to a source code file:
#define ZAKERO_XENIUM_IMPLEMENTATION
#include "Zakero_Xenium.h"
- Add the library to where it is used:
- Link to the X11/XCB libraries and pthread when building:
-lpthread -lxcb -lxcb-xkb -lxcb-randr
- What Is It?
X11 is a Windowing System and is used in many of the Unix-based operating systems such as Linux and BSD. X11/XCB has three parts: the client, the server, and the protocol.
The X11/XCB Server is responsible for rendering and managing all the application windows. The applications are the X11/XCB Clients. These clients tell the Server what to render as well as other requests, such as "minimize this window". Communication between the Server and the Clients is done using the X11 Protocol. XCB is the library that wraps the X11 Protocol to ensure all communication is consistent.
zakero::Xenium sits on top of the XCB library to hide it's complexity while adding as little overhead as possible.
- Why Use It?
XCB was created to allow developers to faster and more responsive applications by by-passing the original X11 libraries. Not only was this goal achieved but parts of the X11 libraries where rewritten to use XCB.
However, what X11 provided was "ease of use". XCB requires the caller to maintain and track state, things that X11 did automatically.
zakero::Xenium aims to have the speed of XCB with the ease of X11, while at the same time offering some improvements. Instead of creating an event loop for all XCB applications, zakero::Xenium only creates one for you, it will only notify you of the events that were supplied lambdas.
- How To Use It?
Step 0
Your compiler must support at least the C++20 standard. The location of the Zakero_*.h
header files must be in your compiler's include path.
Step 1
The first step is to select which C++ source code file will contain the Zakero Xenium implementation. Once the location has been determined, add the following to that file:
#define ZAKERO_XENIUM_IMPLEMENTATION
#include "Zakero_Xenium.h"
The macro ZAKERO_XENIUM_IMPLEMENTATION tells the header file to include the implementation of the Xenium.
In all other files that will use Xenium, they only need to include the header.
Step 2
Below is a simple program that will connect to the X11 Server and display a window.
#define ZAKERO_XENIUM_IMPLEMENTATION
int main()
{
std::error_code error;
if(error)
{
return 1;
}
if(error)
{
return 1;
}
window->titleSet("Xenium");
bool time_to_die = false;
window->onCloseRequest([&]()
{
time_to_die = true;
});
while(time_to_die == false)
{
std::this_thread::yield();
}
delete window;
delete xenium;
return 0;
}
std::string to_string(const bool value) noexcept
Convert a bool into a string.
Definition: Zakero_Base.h:561
A wrapper class for X11/XCB.
Definition: Zakero_Xenium.h:264
Xenium::Window * windowCreate(const Xenium::SizeMm &, std::error_code &) noexcept
Create a window.
Definition: Zakero_Xenium.h:3707
static Xenium * connect() noexcept
Establish a connection with the X11 server.
Definition: Zakero_Xenium.h:2396
Size measured in pixels.
Definition: Zakero_Xenium.h:395
The following commands will build and run the example program.
> g++ -std=c++20 -lpthread -lxcb -lxcb-xkb -lxcb-randr -o example example.cpp
> ./example
- Version
v0.1.0
- Window resizing
- Window image/surface rendering
- Fully multi-threaded, all X11/XCB communication happens in a separate thread.
- Flexible sizing options: Millimeters, Percent, and Pixel