mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-27 13:48:28 +00:00
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl it's the final countdown
This commit is contained in:
82
src/protocols/core/Subcompositor.hpp
Normal file
82
src/protocols/core/Subcompositor.hpp
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
Implementations for:
|
||||
- wl_subsurface
|
||||
- wl_subcompositor
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include "../WaylandProtocol.hpp"
|
||||
#include "wayland.hpp"
|
||||
#include "../../helpers/signal/Signal.hpp"
|
||||
#include "../types/SurfaceRole.hpp"
|
||||
|
||||
class CWLSurfaceResource;
|
||||
|
||||
class CWLSubsurfaceResource : public ISurfaceRole {
|
||||
public:
|
||||
CWLSubsurfaceResource(SP<CWlSubsurface> resource_, SP<CWLSurfaceResource> surface_, SP<CWLSurfaceResource> parent_);
|
||||
~CWLSubsurfaceResource();
|
||||
|
||||
Vector2D posRelativeToParent();
|
||||
bool good();
|
||||
virtual eSurfaceRole role();
|
||||
SP<CWLSurfaceResource> t1Parent();
|
||||
|
||||
bool sync = false;
|
||||
Vector2D position;
|
||||
|
||||
WP<CWLSurfaceResource> surface;
|
||||
WP<CWLSurfaceResource> parent;
|
||||
|
||||
WP<CWLSubsurfaceResource> self;
|
||||
|
||||
struct {
|
||||
CSignal destroy;
|
||||
} events;
|
||||
|
||||
private:
|
||||
SP<CWlSubsurface> resource;
|
||||
|
||||
void destroy();
|
||||
|
||||
struct {
|
||||
CHyprSignalListener commitSurface;
|
||||
} listeners;
|
||||
};
|
||||
|
||||
class CWLSubcompositorResource {
|
||||
public:
|
||||
CWLSubcompositorResource(SP<CWlSubcompositor> resource_);
|
||||
|
||||
bool good();
|
||||
|
||||
private:
|
||||
SP<CWlSubcompositor> resource;
|
||||
};
|
||||
|
||||
class CWLSubcompositorProtocol : public IWaylandProtocol {
|
||||
public:
|
||||
CWLSubcompositorProtocol(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);
|
||||
|
||||
private:
|
||||
void destroyResource(CWLSubcompositorResource* resource);
|
||||
void destroyResource(CWLSubsurfaceResource* resource);
|
||||
|
||||
//
|
||||
std::vector<SP<CWLSubcompositorResource>> m_vManagers;
|
||||
std::vector<SP<CWLSubsurfaceResource>> m_vSurfaces;
|
||||
|
||||
friend class CWLSubcompositorResource;
|
||||
friend class CWLSubsurfaceResource;
|
||||
};
|
||||
|
||||
namespace PROTO {
|
||||
inline UP<CWLSubcompositorProtocol> subcompositor;
|
||||
};
|
Reference in New Issue
Block a user