Optionalmime_types: string[]Checks if a given GObject.GType is part of the given formats.
the GObject.GType to search for
true if the GObject.GType was found
Checks if a given mime type is part of the given formats.
the mime type to search for
true if the mime_type was found
Gets the GObject.GTypes included in formats.
Note that formats may not contain any GObject.GTypes, in particular when
they are empty. In that case null will be returned.
G_TYPE_INVALID-terminated array of types included in formats
Gets the mime types included in formats.
Note that formats may not contain any mime types, in particular
when they are empty. In that case null will be returned.
null-terminated array of interned strings of mime types included in formats
Returns whether the content formats contain any formats.
true if formats contains no mime types and no GTypes
Checks if first and second have any matching formats.
the Gdk.ContentFormats to intersect with
true if a matching format was found.
Finds the first GObject.GType from first that is also contained
in second.
If no matching GObject.GType is found, G_TYPE_INVALID is returned.
the Gdk.ContentFormats to intersect with
The first common GObject.GType or G_TYPE_INVALID if none.
Finds the first mime type from first that is also contained
in second.
If no matching mime type is found, null is returned.
the Gdk.ContentFormats to intersect with
The first common mime type or null if none
Prints the given formats into a string for human consumption.
The result of this function can later be parsed with Gdk.ContentFormats.parse.
a GLib.String to print into
Increases the reference count of a Gdk.ContentFormats by one.
the passed in Gdk.ContentFormats.
Prints the given formats into a human-readable string.
The resulting string can be parsed with Gdk.ContentFormats.parse.
This is a small wrapper around Gdk.ContentFormats.print to help when debugging.
a new string
Append all missing types from second to first, in the order
they had in second.
the Gdk.ContentFormats to merge from
a new Gdk.ContentFormats
Add GTypes for mime types in formats for which deserializers are
registered.
a new Gdk.ContentFormats
Add mime types for GTypes in formats for which deserializers are
registered.
a new Gdk.ContentFormats
Add GTypes for the mime types in formats for which serializers are
registered.
a new Gdk.ContentFormats
Add mime types for GTypes in formats for which serializers are
registered.
a new Gdk.ContentFormats
Decreases the reference count of a Gdk.ContentFormats by one.
If the resulting reference count is zero, frees the formats.
StaticnewOptionalmime_types: string[]Staticnew_StaticparseParses the given string into Gdk.ContentFormats and
returns the formats.
Strings printed via Gdk.ContentFormats.to_string can be read in again successfully using this function.
If string does not describe valid content formats, null
is returned.
the string to parse
Used to advertise and negotiate the format of content.
You will encounter Gdk.ContentFormats when interacting with objects controlling operations that pass data between different widgets, window or application, like Gdk.Drag, Gdk.Drop, Gdk.Clipboard or Gdk.ContentProvider.
GDK supports content in 2 forms: GObject.GType and mime type. Using
GTypesis 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, Gdk.ContentSerializer and Gdk.ContentDeserializer are used.A Gdk.ContentFormats describes a set of possible formats content can be exchanged in. It is assumed that this set is ordered.
GTypesare more important than mime types. Order between differentGTypesor mime types is the order they were added in, most important first. Functions that care about order, such as 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 Gdk.ContentFormats.to_string exists. It will print a comma-separated list of formats from most important to least important.
Gdk.ContentFormats is an immutable struct. After creation, you cannot change the types it represents. Instead, new Gdk.ContentFormats have to be created. The Gdk.ContentFormatsBuilder structure is meant to help in this endeavor.