It derives from <GObject>.
Represents data shared between applications or inside an application.
To get a <GdkClipboard> object, use
display:get-clipboard or
display:get-primary-clipboard. You can find
out about the data that is currently available in a clipboard using
clipboard:get-formats.
To make text or image data available in a clipboard, use
Gdk.Clipboard.set_text or Gdk.Clipboard.set_texture. For
other data, you can use clipboard:set-content?, which takes a
<GdkContentProvider> object.
To read textual or image data from a clipboard, use clipboard:read-text-async or clipboard:read-texture-async. For other data, use
clipboard:read-async, which provides
a <GInputStream> object.
The <GdkContentProvider> or #f if
the clipboard is empty or contents are provided otherwise.
Its value is a <GdkContentProvider>, or
#f.
It is read only.
The <GdkDisplay> that the clipboard belongs to.
Its value is a <GdkDisplay>, or #f.
It can only be set when the object is made, with #:display.
The possible formats that the clipboard can provide its data in.
Its value is a <GdkContentFormats>, or
#f.
It is read only.
#t if the contents of the clipboard are owned by this process.
Its value is a boolean.
It is read only.
Returns the <GdkContentProvider> currently
set on self.
If the self is empty or its contents are not owned by the current
process, #f will be returned.
Passed: a <GdkClipboard>.
Returned: a <GdkContentProvider>, or
#f.
The content of a clipboard if the clipboard does not maintain any content
Gets the <GdkDisplay> that the clipboard was
created for.
Passed: a <GdkClipboard>.
Returned: a <GdkDisplay>.
Gets the formats that the clipboard can provide its current contents in.
Passed: a <GdkClipboard>.
Returned: a <GdkContentFormats>.
The formats of the clipboard
Returns if the clipboard is local.
A clipboard is considered local if it was last claimed by the running application.
Note that clipboard:get-content may
return #f even on a local clipboard. In this case the clipboard
is empty.
Passed: a <GdkClipboard>.
Returned: a boolean.
#t if the clipboard is local
Asynchronously requests an input stream to read the self’s contents from.
The clipboard will choose the most suitable mime type from the given list to fulfill the request, preferring the ones listed first.
Passed: a <GdkClipboard>.
Passed: a list or vector, each a string.
a #f-terminated array of mime types to choose from
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous clipboard read.
See clipboard:read-async.
Passed: a <GdkClipboard>.
Passed: a <GAsyncResult>.
Returned: a <GInputStream>, or #f.
Returned: a string.
location to store the chosen mime type
Asynchronously request the self contents converted to a string.
This is a simple wrapper around clipboard:read-value-async. Use that function or
clipboard:read-async directly if you
need more control over the operation.
Passed: a <GdkClipboard>.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous clipboard read.
See clipboard:read-text-async.
Passed: a <GdkClipboard>.
Passed: a <GAsyncResult>.
Returned: a string, or #f.
a new string
Asynchronously request the self contents converted to a
<GdkPixbuf>.
This is a simple wrapper around clipboard:read-value-async. Use that function or
clipboard:read-async directly if you
need more control over the operation.
Passed: a <GdkClipboard>.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f
to ignore.
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous clipboard read.
See clipboard:read-texture-async.
Passed: a <GdkClipboard>.
Passed: a <GAsyncResult>.
Returned: a <GdkTexture>, or #f.
a new <GdkTexture>
Asynchronously request the self contents converted to the given type.
For local clipboard contents that are available in the given
GType, the value will be copied directly. Otherwise, GDK will
try to use content_deserialize_async to convert the clipboard’s
data.
Passed: a <GdkClipboard>.
Passed: a class, or a GType number.
a GType to read
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous clipboard read.
See clipboard:read-value-async.
Passed: a <GdkClipboard>.
Passed: a <GAsyncResult>.
Returned: a <GValue>.
a <GValue> containing the result.
Sets the clipboard to contain the value collected from the given varargs.
Values should be passed the same way they are passed to other value
collecting APIs, such as GObject.Object.set or
GObject.signal_emit.
gdk_clipboard_set (clipboard, G_TYPE_STRING, "Hello World"); gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture);
Passed: a <GdkClipboard>.
Passed: a <GValue>.
type of value to set
value contents conforming to type
Sets a new content provider on self.
The clipboard will claim the <GdkDisplay>’s
resources and advertise these new contents to other applications.
In the rare case of a failure, this function will return #f. The
clipboard will then continue reporting its old contents and ignore
provider.
If the contents are read by either an external application or the self’s read functions, self will select the best format to transfer the contents and then request that format from provider.
Passed: a <GdkClipboard>.
Passed, or left out: a
<GdkContentProvider>, or #f.
the new contents of self or #f to clear the clipboard
Returned: a boolean.
#t if setting the clipboard succeeded
Asynchronously instructs the self to store its contents remotely.
If the clipboard is not local, this function does nothing but report success.
The purpose of this call is to preserve clipboard contents beyond the lifetime of an application, so this function is typically called on exit. Depending on the platform, the functionality may not be available unless a "clipboard manager" is running.
This function is called automatically when a GtkApplication is shut down, so you likely don’t need to call it.
Passed: a <GdkClipboard>.
Passed: a 32-bit integer.
the I/O priority of the request
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous clipboard store.
Passed: a <GdkClipboard>.
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if storing was successful.
Connect a handler with (connect object clipboard:changed
handler). It is called as (handler self).
Emitted when the clipboard changes ownership.
Passed: a <GdkClipboard>.