ContentFormatsRef

public struct ContentFormatsRef : ContentFormatsProtocol

The ContentFormatsRef type acts as a lightweight Swift reference to an underlying GdkContentFormats instance. It exposes methods that can operate on this data type through ContentFormatsProtocol conformance. Use ContentFormatsRef only as an unowned reference to an existing GdkContentFormats instance.

The 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 [classGdk.Drag], [classGdk.Drop], [classGdk.Clipboard] or [classGdk.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, [classGdk.ContentSerializer] and [classGdk.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 [methodGdk.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 [methodGdk.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 [structGdk.ContentFormatsBuilder]` structure is meant to help in this endeavor.

  • ptr
    Untyped pointer to the underlying `GdkContentFormats` instance.
    

    For type-safe access, use the generated, typed pointer content_formats_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

ContentFormats Record

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GdkContentFormats>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GdkContentFormats>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GdkContentFormats>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GdkContentFormats>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements ContentFormatsProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ContentFormatsProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(cPointer: UnsafeMutablePointer<T>)
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    init<T>(constPointer: UnsafePointer<T>)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    init(mutating raw: UnsafeRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    init(raw: UnsafeMutableRawPointer)
  • Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ContentFormatsProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Creates a new `GdkContentFormats` from an array of mime types.
    

    The mime types must be valid and different from each other or the behavior of the return value is undefined. If you cannot guarantee this, use GdkContentFormatsBuilder instead.

    Declaration

    Swift

    @inlinable
    init(mimeTypes: UnsafeMutablePointer<UnsafePointer<CChar>?>! = nil, nMimeTypes: Int)
  • Creates a new GdkContentFormats for a given GType.

    Declaration

    Swift

    @inlinable
    init(gtype type: GType)
  • Creates a new GdkContentFormats for a given GType.

    Declaration

    Swift

    @inlinable
    static func newForG(gtype type: GType) -> ContentFormatsRef!