summaryrefslogtreecommitdiff
path: root/gdk/gdkclipboard.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2017-11-20 02:06:21 +0100
committerBenjamin Otte <otte@redhat.com>2017-12-03 05:43:24 +0100
commitc91a38b013415b42e32f25c11ebf16897123ed2d (patch)
treedd558d0e4d3b105c8d2862fff16676491e28e32e /gdk/gdkclipboard.c
parent13fb3fd4a0fd2a43a56a2612aa16a126806ee7cd (diff)
downloadgtk+-c91a38b013415b42e32f25c11ebf16897123ed2d.tar.gz
clipboard: Implement gdk_clipboard_read()
Diffstat (limited to 'gdk/gdkclipboard.c')
-rw-r--r--gdk/gdkclipboard.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdk/gdkclipboard.c b/gdk/gdkclipboard.c
index 77862dd55b..eee9284a9a 100644
--- a/gdk/gdkclipboard.c
+++ b/gdk/gdkclipboard.c
@@ -113,6 +113,14 @@ gdk_clipboard_finalize (GObject *object)
G_OBJECT_CLASS (gdk_clipboard_parent_class)->finalize (object);
}
+static GInputStream *
+gdk_clipboard_real_read (GdkClipboard *clipboard,
+ const char *mime_type)
+{
+ /* whoop whooop */
+ return g_memory_input_stream_new ();
+}
+
static void
gdk_clipboard_class_init (GdkClipboardClass *class)
{
@@ -122,6 +130,8 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
object_class->set_property = gdk_clipboard_set_property;
object_class->finalize = gdk_clipboard_finalize;
+ class->read = gdk_clipboard_real_read;
+
/**
* GdkClipboard:display:
*
@@ -227,6 +237,19 @@ gdk_clipboard_get_formats (GdkClipboard *clipboard)
return priv->formats;
}
+GInputStream *
+gdk_clipboard_read (GdkClipboard *clipboard,
+ const char *mime_type)
+{
+ GdkClipboardPrivate *priv = gdk_clipboard_get_instance_private (clipboard);
+
+ g_return_val_if_fail (GDK_IS_CLIPBOARD (clipboard), NULL);
+ g_return_val_if_fail (mime_type != NULL, NULL);
+ g_return_val_if_fail (gdk_content_formats_contain_mime_type (priv->formats, mime_type), NULL);
+
+ return GDK_CLIPBOARD_GET_CLASS (clipboard)->read (clipboard, mime_type);
+}
+
GdkClipboard *
gdk_clipboard_new (GdkDisplay *display)
{