package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gdk/Ocgtk_gdk/Gdk/Wrappers/Content_formats/index.html
Module Wrappers.Content_formats
type t = [ `content_formats ] Gobject.objThe `GdkContentFormats` structure is 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.
val new_ : string array option -> int -> tCreate a new ContentFormats
val new_for_gtype : Gobject.Type.t -> tCreate a new ContentFormats
Add mime types for GTypes in @formats for which serializers are registered.
Add GTypes for the mime types in @formats for which serializers are registered.
Add mime types for GTypes in @formats for which deserializers are registered.
Add GTypes for mime types in @formats for which deserializers are registered.
Append all missing types from @second to @first, in the order they had in @second.
val to_string : t -> stringPrints the given @formats into a human-readable string.
The resulting string can be parsed with func@Gdk.ContentFormats.parse.
This is a small wrapper around method@Gdk.ContentFormats.print to help when debugging.
Finds the first mime type from @first that is also contained in @second.
If no matching mime type is found, %NULL is returned.
val match_gtype : t -> t -> Gobject.Type.tFinds the first `GType` from @first that is also contained in @second.
If no matching `GType` is found, %G_TYPE_INVALID is returned.
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.
val get_gtypes : t -> Gobject.Type.t array option * Gsize.tGets the `GType`s included in @formats.
Note that @formats may not contain any `GType`s, in particular when they are empty. In that case %NULL will be returned.
val contain_mime_type : t -> string -> boolChecks if a given mime type is part of the given @formats.
val contain_gtype : t -> Gobject.Type.t -> boolChecks if a given `GType` is part of the given @formats.
val get_type : unit -> Gobject.Type.t