Package: gdk

GBoxed gdk:content-formats

Details

The gdk:content-formats structure is used to advertise and negotiate the format of content. You will encounter gdk:content-formats instances when interacting with objects controlling operations that pass data between different widgets, window or application, like gdk:drag, gdk:drop, gdk:clipboard or gdk:content-provider objects.

GDK supports content in two 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, the gdk:content-serializer and gdk:content-deserializer objects are used.

A gdk:content-formats instance 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 the gdk:content-formats-union function, 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 gdk:content-formats-to-string function exists. It will print a comma-separated list of formats from most important to least important.

The gdk:content-formats structure is an immutable structure. After creation, you cannot change the types it represents. Instead, new gdk:content-formats instances have to be created. The gdk:content-formats-builder structure is meant to help in this endeavor.
 

Returned by

See also

2023-11-5