mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-15 03:55:46 -07:00
XDG-Output: move to hyprwayland-scanner
This commit is contained in:
@@ -1,18 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "xdg-output-unstable-v1.hpp"
|
||||
#include "WaylandProtocol.hpp"
|
||||
#include <optional>
|
||||
|
||||
class CMonitor;
|
||||
class CXDGOutputProtocol;
|
||||
|
||||
struct SXDGOutput {
|
||||
CMonitor* monitor = nullptr;
|
||||
std::unique_ptr<CWaylandResource> resource;
|
||||
class CXDGOutput {
|
||||
public:
|
||||
CXDGOutput(SP<CZxdgOutputV1> resource, CMonitor* monitor_);
|
||||
|
||||
std::optional<Vector2D> overridePosition;
|
||||
void sendDetails();
|
||||
|
||||
wl_client* client = nullptr;
|
||||
bool isXWayland = false;
|
||||
private:
|
||||
CMonitor* monitor = nullptr;
|
||||
SP<CZxdgOutputV1> resource;
|
||||
|
||||
std::optional<Vector2D> overridePosition;
|
||||
|
||||
wl_client* client = nullptr;
|
||||
bool isXWayland = false;
|
||||
|
||||
friend class CXDGOutputProtocol;
|
||||
};
|
||||
|
||||
class CXDGOutputProtocol : public IWaylandProtocol {
|
||||
@@ -23,12 +33,15 @@ class CXDGOutputProtocol : public IWaylandProtocol {
|
||||
|
||||
void onManagerResourceDestroy(wl_resource* res);
|
||||
void onOutputResourceDestroy(wl_resource* res);
|
||||
void onManagerGetXDGOutput(wl_client* client, wl_resource* resource, uint32_t id, wl_resource* outputResource);
|
||||
void onManagerGetXDGOutput(CZxdgOutputManagerV1* mgr, uint32_t id, wl_resource* outputResource);
|
||||
|
||||
private:
|
||||
void updateOutputDetails(SXDGOutput* pOutput);
|
||||
void updateAllOutputs();
|
||||
void updateAllOutputs();
|
||||
|
||||
std::vector<std::unique_ptr<CWaylandResource>> m_vManagerResources;
|
||||
std::vector<std::unique_ptr<SXDGOutput>> m_vXDGOutputs;
|
||||
};
|
||||
std::vector<UP<CZxdgOutputManagerV1>> m_vManagerResources;
|
||||
std::vector<UP<CXDGOutput>> m_vXDGOutputs;
|
||||
};
|
||||
|
||||
namespace PROTO {
|
||||
inline UP<CXDGOutputProtocol> xdgOutput;
|
||||
};
|
||||
|
Reference in New Issue
Block a user