Basics
Guides
API Reference
Basics
Guides
API Reference
[35:7] extends: object
Used to advertise and negotiate the format of content. You will encounter
GdkContentFormats when interacting with objects controlling operations that
pass data between different widgets, window or application, like
[class@Gdk.Drag], [class@Gdk.Drop], [class@Gdk.Clipboard] or
[class@Gdk.ContentProvider]. GDK supports content in 2 forms: GType and
mime type. Using GTypes is meant only for in-process content transfers.
Mime types are meant to be used for data passing both in-process and
out-of-process. The details of how data is passed is described in the
documentation of the actual implementations. To transform between the two
forms, [class@Gdk.ContentSerializer] and [class@Gdk.ContentDeserializer] are
used. A GdkContentFormats describes a set of possible formats content can
be exchanged in. It is assumed that this set is ordered. GTypes are more
important than mime types. Order between different GTypes or mime types is
the order they were added in, most important first. Functions that care about
order, such as [method@Gdk.ContentFormats.union], will describe in their
documentation how they interpret that order, though in general the order of
the first argument is considered the primary order of the result, followed by
the order of further arguments. For debugging purposes, the function
[method@Gdk.ContentFormats.to_string] exists. It will print a comma-separated
list of formats from most important to least important. GdkContentFormats
is an immutable struct. After creation, you cannot change the types it
represents. Instead, new GdkContentFormats have to be created. The
[struct@Gdk.ContentFormatsBuilder] structure is meant to help in this
endeavor.
ContentFormats (Handle = null)
Creates a new
ContentFormatsby 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.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.