Gdk.ContentProvider.new_union
Description: Reference for Gdk.ContentProvider.new_union

### Constructor

# Gdk ContentProvidernew_union

#### Declaration [src]

    GdkContentProvider*
    gdk_content_provider_new_union (
      GdkContentProvider** providers,
      gsize n_providers
    )

#### Description [src]

Creates a content provider that represents all the given `providers`.

Whenever data needs to be written, the union provider will try the given `providers` in the given order and the first one supporting a format will be chosen to provide it.

This allows an easy way to support providing data in different formats. For example, an image may be provided by its file and by the image contents with a call such as

    gdk_content_provider_new_union ((GdkContentProvider *[2]) {
                                      gdk_content_provider_new_typed (G_TYPE_FILE, file),
                                      gdk_content_provider_new_typed (G_TYPE_TEXTURE, texture)
                                    }, 2);

#### Parameters

`providers`

  Type: An array of `GdkContentProvider*`

  The `GdkContentProvider`s to present the union of.

  The argument can be `NULL`.
  The length of the array is specified in the `n_providers` argument.
  The called function takes ownership of the data, and is responsible for freeing it.

`n_providers`

  Type: `gsize`

  The number of providers.

#### Return value

Type: `GdkContentProvider`

A new `GdkContentProvider`

The caller of the function takes ownership of the data, and is responsible for freeing it.