summaryrefslogtreecommitdiff
path: root/src/clipboard-gtk.hh
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2022-09-01 18:34:03 +0200
committerChristian Persch <chpe@src.gnome.org>2022-09-01 18:34:03 +0200
commitb72b397be45045bc5464ba8ed889f6fb2b39989a (patch)
treecf0177eb3aaf3d4862c303ec873b1bbb5afa57b6 /src/clipboard-gtk.hh
parentfd6d6226272cda3e8c4d4a58e84c796656264566 (diff)
downloadvte-b72b397be45045bc5464ba8ed889f6fb2b39989a.tar.gz
widget: Implement clipboard for gtk4
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2557
Diffstat (limited to 'src/clipboard-gtk.hh')
-rw-r--r--src/clipboard-gtk.hh15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/clipboard-gtk.hh b/src/clipboard-gtk.hh
index 45660c3e..c09fd6fe 100644
--- a/src/clipboard-gtk.hh
+++ b/src/clipboard-gtk.hh
@@ -31,7 +31,10 @@ namespace vte::platform {
enum class ClipboardFormat {
TEXT,
- HTML
+ HTML,
+#if VTE_GTK == 4
+ INVALID = -1
+#endif
};
enum class ClipboardType {
@@ -39,7 +42,14 @@ enum class ClipboardType {
PRIMARY = 1
};
+#if VTE_GTK == 4
+class ContentProvider;
+#endif
+
class Clipboard : public std::enable_shared_from_this<Clipboard> {
+#if VTE_GTK == 4
+ friend class ContentProvider;
+#endif
public:
Clipboard(Widget& delegate,
ClipboardType type) /* throws */;
@@ -69,7 +79,8 @@ public:
OfferGetCallback get_callback,
OfferClearCallback clear_callback) /* throws */;
- void set_text(std::string_view const& text) noexcept;
+ void set_text(char const* text,
+ size_t size) noexcept;
void request_text(RequestDoneCallback done_callback,
RequestFailedCallback failed_callback) /* throws */;