TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_sdl_clipboard.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstdint>
6#include <span>
7#include <string_view>
8#include <vector>
9
10namespace tachyon
11{
14 std::vector<uint8_t> EncodeClipboardImage(const ClipboardImage& image, std::string_view mimeType);
17 ClipboardImage DecodeClipboardImage(std::span<const uint8_t> bytes, std::string_view mimeType);
18
21
24 class SDLClipboard : public IClipboard
25 {
26 public:
27 std::string Get() const override;
28 void Set(std::string_view text) override;
29
30 bool HasImage() const override;
31 ClipboardImage GetImage() const override;
32 bool SetImage(const ClipboardImage& image) override;
33 };
34
35}
The clipboard text editors copy to and paste from, and images go through; GUIApplication::SetClipboar...
Definition gui_clipboard.h:29
The system clipboard, through SDL.
Definition gui_sdl_clipboard.h:25
bool SetImage(const ClipboardImage &image) override
Puts an image on the clipboard.
ClipboardImage GetImage() const override
The clipboard's image; an empty one when it holds none, or it can't be read.
std::string Get() const override
The clipboard's text, UTF-8; empty when it holds none.
void Set(std::string_view text) override
Puts UTF-8 text on the clipboard.
bool HasImage() const override
Whether the clipboard holds an image. A clipboard without images says no.
Definition gui_logging.h:24
ClipboardImage DecodeClipboardImage(std::span< const uint8_t > bytes, std::string_view mimeType)
The image in the bytes of a file of mimeType ("image/png" or "image/bmp"); an empty one when they can...
std::vector< uint8_t > EncodeClipboardImage(const ClipboardImage &image, std::string_view mimeType)
An image as the bytes of a file of mimeType ("image/png" or "image/bmp"); empty when the image is,...
An image on the clipboard: RGBA, 8 bits a channel, alpha not premultiplied, rows from the top.
Definition gui_clipboard.h:16