2023-07-18 15:30:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
2024-04-20 20:34:18 +02:00
|
|
|
#include "xdg-output-unstable-v1.hpp"
|
2023-07-18 15:30:28 +02:00
|
|
|
#include "WaylandProtocol.hpp"
|
2023-08-15 17:55:29 +02:00
|
|
|
#include <optional>
|
2023-07-18 15:30:28 +02:00
|
|
|
|
|
|
|
class CMonitor;
|
2024-04-20 20:34:18 +02:00
|
|
|
class CXDGOutputProtocol;
|
2024-10-09 01:26:40 +02:00
|
|
|
class CWLOutputProtocol;
|
2023-07-18 15:30:28 +02:00
|
|
|
|
2024-04-20 20:34:18 +02:00
|
|
|
class CXDGOutput {
|
|
|
|
public:
|
2024-10-26 03:06:13 +02:00
|
|
|
CXDGOutput(SP<CZxdgOutputV1> resource, PHLMONITOR monitor_);
|
2024-04-20 20:34:18 +02:00
|
|
|
|
|
|
|
void sendDetails();
|
|
|
|
|
|
|
|
private:
|
2024-10-26 03:06:13 +02:00
|
|
|
PHLMONITORREF monitor;
|
2024-04-20 20:34:18 +02:00
|
|
|
SP<CZxdgOutputV1> resource;
|
2024-10-09 01:26:40 +02:00
|
|
|
WP<CWLOutputProtocol> outputProto;
|
2023-07-18 15:30:28 +02:00
|
|
|
|
2024-04-20 20:34:18 +02:00
|
|
|
std::optional<Vector2D> overridePosition;
|
2023-08-15 17:55:29 +02:00
|
|
|
|
2024-04-20 20:34:18 +02:00
|
|
|
wl_client* client = nullptr;
|
|
|
|
bool isXWayland = false;
|
|
|
|
|
|
|
|
friend class CXDGOutputProtocol;
|
2023-07-18 15:30:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
2024-10-05 01:43:59 +02:00
|
|
|
void updateAllOutputs();
|
2023-07-18 15:30:28 +02:00
|
|
|
|
|
|
|
private:
|
2024-04-21 20:29:45 +02:00
|
|
|
void onManagerResourceDestroy(wl_resource* res);
|
|
|
|
void onOutputResourceDestroy(wl_resource* res);
|
|
|
|
void onManagerGetXDGOutput(CZxdgOutputManagerV1* mgr, uint32_t id, wl_resource* outputResource);
|
2024-04-20 20:34:18 +02:00
|
|
|
|
2024-04-21 20:29:45 +02:00
|
|
|
//
|
2024-04-20 20:34:18 +02:00
|
|
|
std::vector<UP<CZxdgOutputManagerV1>> m_vManagerResources;
|
|
|
|
std::vector<UP<CXDGOutput>> m_vXDGOutputs;
|
2024-04-21 20:29:45 +02:00
|
|
|
|
|
|
|
friend class CXDGOutput;
|
2024-04-20 20:34:18 +02:00
|
|
|
};
|
2023-07-18 15:30:28 +02:00
|
|
|
|
2024-04-20 20:34:18 +02:00
|
|
|
namespace PROTO {
|
|
|
|
inline UP<CXDGOutputProtocol> xdgOutput;
|
|
|
|
};
|