Basics
Guides
API Reference
Basics
Guides
API Reference
[513:14] static extends: object
Generated metadata helpers for Clipboard class surfaces.
properties ()
Returns property metadata for
Clipboard.
A list.signals ()
Returns signal metadata for
Clipboard.
A list.[443:7] extends: object
Generated low-level callback wrapper for GIR callback changed.
GdkClipboardChangedCallback (callback Fn, UserData = null)
Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking
Fn.
Fn is the Aussom callback implementation.UserData is retained and passed through to Fn on each invocation when provided.trampoline (nativeSelf, nativeUserData)
Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.
callback ()
Returns the wrapped NativeCallback.
handle ()
Returns the callback as a NativeHandle.
close ()
Closes the underlying NativeCallback.
isClosed ()
Returns true when the callback has been closed.
[23:7] extends: object
Represents data shared between applications or inside an application. To get
a GdkClipboard object, use [method@Gdk.Display.get_clipboard] or
[method@Gdk.Display.get_primary_clipboard]. You can find out about the data
that is currently available in a clipboard using
[method@Gdk.Clipboard.get_formats]. To make text or image data available in a
clipboard, use [method@Gdk.Clipboard.set_text] or
[method@Gdk.Clipboard.set_texture]. For other data, you can use
[method@Gdk.Clipboard.set_content], which takes a [class@Gdk.ContentProvider]
object. To read textual or image data from a clipboard, use
[method@Gdk.Clipboard.read_text_async] or
[method@Gdk.Clipboard.read_texture_async]. For other data, use
[method@Gdk.Clipboard.read_async], which provides a GInputStream object.
GdkClipboard (Handle = null)
Creates a new
Clipboardby wrapping a native handle or another wrapper.
Handle is the native handle or another wrapper whose handle to adopt.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asObject ()
Wraps this handle as
GObject.
A GObject object.connectSignal (string Name, CallbackObj)
Connects one generated callback wrapper to a named signal.
Name is the signal name.CallbackObj is the generated callback wrapper to connect.The connected handler id.disconnectSignalHandler (int HandlerId)
Disconnects one retained signal handler id.
HandlerId is the signal handler id to disconnect.None.setOnChanged (callback Fn, UserData = null)
Emitted when the clipboard changes ownership.
Fn is the Aussom callback.Fn is called with (GdkClipboard Self).UserData is retained and passed through to the generated callback wrapper when provided.The connected handler id.get_content ()
Returns the
GdkContentProvidercurrently set on @clipboard. If the
is empty or its contents are not owned by the current process, %NULL will be returned.The content of a clipboard if the clipboard does not maintain any content.get_display ()
Gets the
GdkDisplaythat the clipboard was created for.
a GdkDisplay.get_formats ()
Gets the formats that the clipboard can provide its current contents in.
The formats of the clipboard.is_local ()
Returns if the clipboard is local. A clipboard is considered local if it was last claimed by the running application. Note that [method@Gdk.Clipboard.get_content] may return %NULL even on a local clipboard. In this case the clipboard is empty.
%TRUE if the clipboard is local.read_async (list mime_types, int io_priority, object cancellable, user_data)
Asynchronously requests an input stream to read the @clipboard'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.
mime_types is a %NULL-terminated array of mime types to choose from.io_priority is the I/O priority of the request.cancellable is optional GCancellable object.callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.read_finish (object result)
Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_async].
result is a GAsyncResult.out_mime_type is location to store the chosen mime type.a GInputStream.read_text_async (object cancellable, user_data)
Asynchronously request the @clipboard contents converted to a string. This is a simple wrapper around [method@Gdk.Clipboard.read_value_async]. Use that function or [method@Gdk.Clipboard.read_async] directly if you need more control over the operation.
cancellable is optional GCancellable object.callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.read_text_finish (object result)
Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_text_async].
result is a GAsyncResult.a new string.read_texture_async (object cancellable, user_data)
Asynchronously request the @clipboard contents converted to a
GdkPixbuf. This is a simple wrapper around [method@Gdk.Clipboard.read_value_async]. Use that function or [method@Gdk.Clipboard.read_async] directly if you need more control over the operation.
cancellable is optional GCancellable object, %NULL to ignore..callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.read_texture_finish (object result)
Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_texture_async].
result is a GAsyncResult.a new GdkTexture.read_value_async (int type, int io_priority, object cancellable, user_data)
Asynchronously request the @clipboard contents converted to the given
For local clipboard contents that are available in the given GType, the value will be copied directly. Otherwise, GDK will try to use [func@content_deserialize_async] to convert the clipboard's data.type is a GType to read.io_priority is the I/O priority of the request.cancellable is optional GCancellable object.callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.read_value_finish (object result)
Finishes an asynchronous clipboard read. See [method@Gdk.Clipboard.read_value_async].
result is a GAsyncResult.a GValue containing the result..set (int type, list varargs)
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 [method@GObject.Object.set] or [func@GObject.signal_emit].
c gdk_clipboard_set (clipboard, G_TYPE_STRING, "Hello World"); gdk_clipboard_set (clipboard, GDK_TYPE_TEXTURE, some_texture);
type is type of value to set.... is value contents conforming to @type.None.set_content (object provider)
Sets a new content provider on @clipboard. 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 %FALSE. The clipboard will then continue reporting its old contents and ignore @provider. If the contents are read by either an external application or the @clipboard's read functions, @clipboard will select the best format to transfer the contents and then request that format from @provider.
provider is the new contents of @clipboard or %NULL to clear the clipboard.%TRUE if setting the clipboard succeeded.set_text (string text)
Puts the given @text into the clipboard.
text is Text to put into the clipboard.None.set_texture (object texture)
Puts the given @texture into the clipboard.
texture is a GdkTexture to put into the clipboard.None.set_value (object value)
Sets the @clipboard to contain the given @value.
value is a GValue to set.None.store_async (int io_priority, object cancellable, user_data)
Asynchronously instructs the @clipboard 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.
io_priority is the I/O priority of the request.cancellable is optional GCancellable object.callback is callback to call when the request is satisfied.user_data is the data to pass to callback function.None.store_finish (object result)
Finishes an asynchronous clipboard store. See [method@Gdk.Clipboard.store_async].
result is a GAsyncResult.%TRUE if storing was successful..
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.