34 virtual std::string
Get()
const = 0;
36 virtual void Set(std::string_view text) = 0;
39 virtual bool HasImage()
const {
return false; }
51 std::string
Get()
const override {
return m_text; }
52 void Set(std::string_view text)
override { m_text = text; m_image = {}; }
54 bool HasImage()
const override {
return !m_image.Empty(); }
The clipboard text editors copy to and paste from, and images go through; GUIApplication::SetClipboar...
Definition gui_clipboard.h:29
virtual ClipboardImage GetImage() const
The clipboard's image; an empty one when it holds none, or it can't be read.
Definition gui_clipboard.h:41
virtual void Set(std::string_view text)=0
Puts UTF-8 text on the clipboard.
virtual std::string Get() const =0
The clipboard's text, UTF-8; empty when it holds none.
virtual ~IClipboard()=default
virtual bool HasImage() const
Whether the clipboard holds an image. A clipboard without images says no.
Definition gui_clipboard.h:39
virtual bool SetImage(const ClipboardImage &image)
Puts an image on the clipboard.
Definition gui_clipboard.h:44
A clipboard inside the process, not shared with other applications.
Definition gui_clipboard.h:49
ClipboardImage GetImage() const override
The clipboard's image; an empty one when it holds none, or it can't be read.
Definition gui_clipboard.h:55
bool SetImage(const ClipboardImage &image) override
Puts an image on the clipboard.
Definition gui_clipboard.h:56
void Set(std::string_view text) override
Puts UTF-8 text on the clipboard.
Definition gui_clipboard.h:52
bool HasImage() const override
Whether the clipboard holds an image. A clipboard without images says no.
Definition gui_clipboard.h:54
std::string Get() const override
The clipboard's text, UTF-8; empty when it holds none.
Definition gui_clipboard.h:51
Definition gui_logging.h:24
An image on the clipboard: RGBA, 8 bits a channel, alpha not premultiplied, rows from the top.
Definition gui_clipboard.h:16
bool Empty() const
No image: no size, or not as many bytes as the size needs.
Definition gui_clipboard.h:22
std::vector< uint8_t > rgba
width * height * 4 bytes
Definition gui_clipboard.h:19
uint32_t height
Definition gui_clipboard.h:18
uint32_t width
Definition gui_clipboard.h:17