mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-12-22 10:29:48 +01:00
core: allow specifying names for outputs
This commit is contained in:
parent
51cd6f4374
commit
13f94112aa
7 changed files with 19 additions and 24 deletions
|
@ -66,16 +66,16 @@ namespace Aquamarine {
|
|||
AQ_BACKEND_CAPABILITY_POINTER = (1 << 0),
|
||||
};
|
||||
|
||||
virtual eBackendType type() = 0;
|
||||
virtual bool start() = 0;
|
||||
virtual std::vector<Hyprutils::Memory::CSharedPointer<SPollFD>> pollFDs() = 0;
|
||||
virtual int drmFD() = 0;
|
||||
virtual bool dispatchEvents() = 0;
|
||||
virtual uint32_t capabilities() = 0;
|
||||
virtual void onReady() = 0;
|
||||
virtual std::vector<SDRMFormat> getRenderFormats() = 0;
|
||||
virtual std::vector<SDRMFormat> getCursorFormats() = 0;
|
||||
virtual bool createOutput() = 0;
|
||||
virtual eBackendType type() = 0;
|
||||
virtual bool start() = 0;
|
||||
virtual std::vector<Hyprutils::Memory::CSharedPointer<SPollFD>> pollFDs() = 0;
|
||||
virtual int drmFD() = 0;
|
||||
virtual bool dispatchEvents() = 0;
|
||||
virtual uint32_t capabilities() = 0;
|
||||
virtual void onReady() = 0;
|
||||
virtual std::vector<SDRMFormat> getRenderFormats() = 0;
|
||||
virtual std::vector<SDRMFormat> getCursorFormats() = 0;
|
||||
virtual bool createOutput(const std::string& name = "") = 0; // "" means auto
|
||||
};
|
||||
|
||||
class CBackend {
|
||||
|
|
|
@ -289,7 +289,7 @@ namespace Aquamarine {
|
|||
virtual void onReady();
|
||||
virtual std::vector<SDRMFormat> getRenderFormats();
|
||||
virtual std::vector<SDRMFormat> getCursorFormats();
|
||||
virtual bool createOutput();
|
||||
virtual bool createOutput(const std::string& name = "");
|
||||
|
||||
Hyprutils::Memory::CWeakPointer<CDRMBackend> self;
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace Aquamarine {
|
|||
virtual void onReady();
|
||||
virtual std::vector<SDRMFormat> getRenderFormats();
|
||||
virtual std::vector<SDRMFormat> getCursorFormats();
|
||||
virtual bool createOutput();
|
||||
virtual bool createOutput(const std::string& name = "");
|
||||
|
||||
Hyprutils::Memory::CWeakPointer<CHeadlessBackend> self;
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace Aquamarine {
|
|||
virtual void onReady();
|
||||
virtual std::vector<SDRMFormat> getRenderFormats();
|
||||
virtual std::vector<SDRMFormat> getCursorFormats();
|
||||
virtual bool createOutput();
|
||||
virtual bool createOutput(const std::string& name = "");
|
||||
|
||||
Hyprutils::Memory::CWeakPointer<CWaylandBackend> self;
|
||||
|
||||
|
@ -142,7 +142,6 @@ namespace Aquamarine {
|
|||
void initSeat();
|
||||
void initShell();
|
||||
bool initDmabuf();
|
||||
void createOutput(const std::string& szName);
|
||||
|
||||
//
|
||||
Hyprutils::Memory::CWeakPointer<CBackend> backend;
|
||||
|
|
|
@ -117,8 +117,8 @@ std::vector<SDRMFormat> Aquamarine::CHeadlessBackend::getCursorFormats() {
|
|||
return {}; // No cursor support
|
||||
}
|
||||
|
||||
bool Aquamarine::CHeadlessBackend::createOutput() {
|
||||
auto output = SP<CHeadlessOutput>(new CHeadlessOutput(std::format("HEADLESS-{}", ++outputIDCounter), self.lock()));
|
||||
bool Aquamarine::CHeadlessBackend::createOutput(const std::string& name) {
|
||||
auto output = SP<CHeadlessOutput>(new CHeadlessOutput(name.empty() ? std::format("HEADLESS-{}", ++outputIDCounter) : name, self.lock()));
|
||||
outputs.emplace_back(output);
|
||||
output->swapchain = CSwapchain::create(backend->allocator, self.lock());
|
||||
output->self = output;
|
||||
|
|
|
@ -134,10 +134,11 @@ int Aquamarine::CWaylandBackend::drmFD() {
|
|||
return drmState.fd;
|
||||
}
|
||||
|
||||
void Aquamarine::CWaylandBackend::createOutput(const std::string& szName) {
|
||||
auto o = outputs.emplace_back(SP<CWaylandOutput>(new CWaylandOutput(szName, self)));
|
||||
bool Aquamarine::CWaylandBackend::createOutput(const std::string& szName) {
|
||||
auto o = outputs.emplace_back(SP<CWaylandOutput>(new CWaylandOutput(szName.empty() ? std::format("WAYLAND-{}", ++lastOutputID) : szName, self)));
|
||||
o->self = o;
|
||||
idleCallbacks.emplace_back([this, o]() { backend->events.newOutput.emit(SP<IOutput>(o)); });
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<Hyprutils::Memory::CSharedPointer<SPollFD>> Aquamarine::CWaylandBackend::pollFDs() {
|
||||
|
@ -431,11 +432,6 @@ std::vector<SDRMFormat> Aquamarine::CWaylandBackend::getCursorFormats() {
|
|||
return dmabufFormats;
|
||||
}
|
||||
|
||||
bool Aquamarine::CWaylandBackend::createOutput() {
|
||||
createOutput(std::format("WAYLAND-{}", ++lastOutputID));
|
||||
return true;
|
||||
}
|
||||
|
||||
Aquamarine::CWaylandOutput::CWaylandOutput(const std::string& name_, Hyprutils::Memory::CWeakPointer<CWaylandBackend> backend_) : backend(backend_) {
|
||||
name = name_;
|
||||
|
||||
|
|
|
@ -651,7 +651,7 @@ std::vector<SDRMFormat> Aquamarine::CDRMBackend::getCursorFormats() {
|
|||
return {};
|
||||
}
|
||||
|
||||
bool Aquamarine::CDRMBackend::createOutput() {
|
||||
bool Aquamarine::CDRMBackend::createOutput(const std::string&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue