Add C++20 RAII wrapper around wlroots 0.20 + scenefx

Wraps wlroots' C ABI behind owning types (Display, Backend, Compositor,
Output, XdgShell/Toplevel, Seat/Cursor/Keyboard, Scene/Node/Tree) with
wl_signal -> std::function callbacks. Links the scenefx effect engine and
ships a wlr::fx animation helper. Includes a runnable tinywl-style compositor
and a scene/blur demo.

License: AGPL-3.0-only.
This commit is contained in:
AstralZX
2026-08-29 09:12:28 +02:00
commit 89cbf733b3
20 changed files with 2008 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: AGPL-3.0-only
#pragma once
#include <wayland-server-core.h>
#include "wlr/wlr.hpp"
namespace wlr {
class Display {
public:
Display() : m_display(wl_display_create()) {}
~Display() { if (m_display) wl_display_destroy(m_display); }
Display(const Display&) = delete;
Display& operator=(const Display&) = delete;
Display(Display&&) = delete;
Display& operator=(Display&&) = delete;
struct wl_display* raw() const { return m_display; }
explicit operator bool() const { return m_display != nullptr; }
struct wl_event_loop* event_loop() const { return wl_display_get_event_loop(m_display); }
void set_terminate() { wl_display_terminate(m_display); }
void run() { wl_display_run(m_display); }
bool init_shm() { return wl_display_init_shm(m_display); }
const char* add_socket_auto() {
const char* name = wl_display_add_socket_auto(m_display);
return name;
}
void flush_clients() { wl_display_flush_clients(m_display); }
private:
struct wl_display* m_display;
};
}