From addd3e7f1aeb670dd91d26005aaeccce3efb1ae7 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 25 May 2024 22:43:51 +0200 Subject: xwayland: move to hyprland impl (#6086) --- src/protocols/XWaylandShell.hpp | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/protocols/XWaylandShell.hpp (limited to 'src/protocols/XWaylandShell.hpp') diff --git a/src/protocols/XWaylandShell.hpp b/src/protocols/XWaylandShell.hpp new file mode 100644 index 00000000..2c03d172 --- /dev/null +++ b/src/protocols/XWaylandShell.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include +#include +#include +#include "WaylandProtocol.hpp" +#include "xwayland-shell-v1.hpp" +#include "../helpers/signal/Signal.hpp" + +class CXWaylandSurfaceResource { + public: + CXWaylandSurfaceResource(SP resource_, wlr_surface* surface_); + ~CXWaylandSurfaceResource(); + + bool good(); + wl_client* client(); + + struct { + CSignal destroy; + } events; + + uint64_t serial = 0; + wlr_surface* surface = nullptr; + + WP self; + + private: + SP resource; + wl_client* pClient = nullptr; +}; + +class CXWaylandShellResource { + public: + CXWaylandShellResource(SP resource_); + + bool good(); + + private: + SP resource; +}; + +class CXWaylandShellProtocol : public IWaylandProtocol { + public: + CXWaylandShellProtocol(const wl_interface* iface, const int& ver, const std::string& name); + + virtual void bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id); + + struct { + CSignal newSurface; // SP. Fired when it sets a serial, otherwise it's useless + } events; + + private: + void destroyResource(CXWaylandSurfaceResource* resource); + void destroyResource(CXWaylandShellResource* resource); + + // + std::vector> m_vManagers; + std::vector> m_vSurfaces; + + friend class CXWaylandSurfaceResource; + friend class CXWaylandShellResource; +}; + +namespace PROTO { + inline UP xwaylandShell; +}; -- cgit v1.2.3