2023-07-18 15:30:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "WaylandProtocol.hpp"
|
2023-08-15 17:55:29 +02:00
|
|
|
#include <optional>
|
2023-07-18 15:30:28 +02:00
|
|
|
|
|
|
|
class CMonitor;
|
|
|
|
|
|
|
|
struct SXDGOutput {
|
|
|
|
CMonitor* monitor = nullptr;
|
|
|
|
std::unique_ptr<CWaylandResource> resource;
|
|
|
|
|
2023-08-15 17:55:29 +02:00
|
|
|
std::optional<Vector2D> overridePosition;
|
|
|
|
|
2023-07-18 15:30:28 +02:00
|
|
|
wl_client* client = nullptr;
|
|
|
|
bool isXWayland = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CXDGOutputProtocol : public IWaylandProtocol {
|
|
|
|
public:
|
|
|
|
CXDGOutputProtocol(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);
|
|
|
|
|
|
|
|
void onManagerResourceDestroy(wl_resource* res);
|
|
|
|
void onOutputResourceDestroy(wl_resource* res);
|
|
|
|
void onManagerGetXDGOutput(wl_client* client, wl_resource* resource, uint32_t id, wl_resource* outputResource);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateOutputDetails(SXDGOutput* pOutput);
|
|
|
|
void updateAllOutputs();
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<CWaylandResource>> m_vManagerResources;
|
|
|
|
std::vector<std::unique_ptr<SXDGOutput>> m_vXDGOutputs;
|
|
|
|
};
|