wl-data-device: move to hyprland impl
This commit is contained in:
parent
fc72df8e58
commit
7eeee2c94e
16 changed files with 963 additions and 171 deletions
17
src/protocols/types/DataDevice.cpp
Normal file
17
src/protocols/types/DataDevice.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "DataDevice.hpp"
|
||||
|
||||
bool IDataSource::hasDnd() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IDataSource::dndDone() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IDataSource::used() {
|
||||
return wasUsed;
|
||||
}
|
||||
|
||||
void IDataSource::markUsed() {
|
||||
wasUsed = true;
|
||||
}
|
||||
29
src/protocols/types/DataDevice.hpp
Normal file
29
src/protocols/types/DataDevice.hpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include "../../helpers/signal/Signal.hpp"
|
||||
|
||||
class IDataSource {
|
||||
public:
|
||||
IDataSource() {}
|
||||
virtual ~IDataSource() {}
|
||||
|
||||
virtual std::vector<std::string> mimes() = 0;
|
||||
virtual void send(const std::string& mime, uint32_t fd) = 0;
|
||||
virtual void accepted(const std::string& mime) = 0;
|
||||
virtual void cancelled() = 0;
|
||||
virtual bool hasDnd();
|
||||
virtual bool dndDone();
|
||||
virtual bool used();
|
||||
virtual void markUsed();
|
||||
virtual void error(uint32_t code, const std::string& msg) = 0;
|
||||
|
||||
struct {
|
||||
CSignal destroy;
|
||||
} events;
|
||||
|
||||
private:
|
||||
bool wasUsed = false;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue