It derives from <GObject>.
Provides content for the clipboard or for drag-and-drop operations in a number of formats.
To create a <GdkContentProvider>, use
content-provider:new-for-value or
content-provider:new-for-bytes.
GDK knows how to handle common text and image formats out-of-the-box.
See <GdkContentSerializer> and
<GdkContentDeserializer> if you want
to add support for application-specific data formats.
parentThe possible formats that the provider can provide its data in.
Its value is a <GdkContentFormats>, or
#f.
It is read only.
The subset of formats that clipboard managers should store this provider’s data in.
Its value is a <GdkContentFormats>, or
#f.
It is read only.
Emits the ::content-changed signal.
Passed: a <GdkContentProvider>.
Gets the contents of self stored in value.
The value will have been initialized to the GType the value
should be provided in. This given GType does not need to be
listed in the formats returned by content-provider:ref-formats. However, if the given
GType is not supported, this operation can fail and
not-supported will be reported.
Passed: a <GdkContentProvider>.
Passed, filled in, and returned: a <GValue>.
the <GValue> to fill
Returned: a boolean.
#t if the value was set successfully. Otherwise error will
be set to describe the failure.
Create a content provider that provides the given bytes as data for the given mime-type.
Passed: a string.
the mime type
Passed: a <GBytes>.
a <GBytes> with the data for mime-type
Returned: a <GdkContentProvider>.
a new <GdkContentProvider>
Create a content provider that provides the given value.
Passed: a <GValue>.
a <GValue>
Returned: a <GdkContentProvider>.
a new <GdkContentProvider>
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 (GDK_TYPE_TEXTURE, texture)
}, 2);
Passed: a list or vector, each a
<GdkContentProvider>, or #f.
The <GdkContentProvider>s to present the
union of
Returned: a <GdkContentProvider>.
a new <GdkContentProvider>
Not passed: guile-gi gives the length of providers.
the number of providers
Gets the formats that the provider can provide its current contents in.
Passed: a <GdkContentProvider>.
Returned: a <GdkContentFormats>.
The formats of the provider
Gets the formats that the provider suggests other applications to store the data in.
An example of such an application would be a clipboard manager.
This can be assumed to be a subset of content-provider:ref-formats.
Passed: a <GdkContentProvider>.
Returned: a <GdkContentFormats>.
The storable formats of the provider
Asynchronously writes the contents of self to stream in the given mime-type.
The given mime type does not need to be listed in the formats returned
by content-provider:ref-formats. However, if the given
GType is not supported,
not-supported will be reported.
The given stream will not be closed.
Passed: a <GdkContentProvider>.
Passed: a string.
the mime type to provide the data in
Passed: a <GOutputStream>.
the <GOutputStream> to write to
Passed: a 32-bit integer.
I/O priority of the request.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f
to ignore.
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous write operation.
See content-provider:write-mime-type-async.
Passed: a <GdkContentProvider>.
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation was completed successfully. Otherwise
error will be set to describe the failure.
Connect a handler with (connect object
content-provider:content-changed handler). It is called as
(handler self).
Emitted whenever the content provided by this provider has changed.
Passed: a <GdkContentProvider>.
To override it in a new class, give register-type #:vfuncs
`((attach-clipboard . ,procedure)). The procedure is called as
(procedure self clipboard).
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Passed: a <GdkClipboard>.
Emits the ::content-changed signal.
To override it in a new class, give register-type #:vfuncs
`((content-changed . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
To override it in a new class, give register-type #:vfuncs
`((detach-clipboard . ,procedure)). The procedure is called as
(procedure self clipboard).
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Passed: a <GdkClipboard>.
Gets the contents of self stored in value.
The value will have been initialized to the GType the value
should be provided in. This given GType does not need to be
listed in the formats returned by content-provider:ref-formats. However, if the given
GType is not supported, this operation can fail and
not-supported will be reported.
To override it in a new class, give register-type #:vfuncs
`((get-value . ,procedure)). The procedure is called as
(procedure self value) ⇒ %return.
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Passed, filled in, and returned: a <GValue>.
the <GValue> to fill
Returned: a boolean.
#t if the value was set successfully. Otherwise error will
be set to describe the failure.
Gets the formats that the provider can provide its current contents in.
To override it in a new class, give register-type #:vfuncs
`((ref-formats . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Returned: a <GdkContentFormats>.
The formats of the provider
Gets the formats that the provider suggests other applications to store the data in.
An example of such an application would be a clipboard manager.
This can be assumed to be a subset of content-provider:ref-formats.
To override it in a new class, give register-type #:vfuncs
`((ref-storable-formats . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Returned: a <GdkContentFormats>.
The storable formats of the provider
Asynchronously writes the contents of self to stream in the given mime-type.
The given mime type does not need to be listed in the formats returned
by content-provider:ref-formats. However, if the given
GType is not supported,
not-supported will be reported.
The given stream will not be closed.
To override it in a new class, give register-type #:vfuncs
`((write-mime-type-async . ,procedure)). The procedure is called as
(procedure self mime-type stream io-priority cancellable callback
user-data).
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Passed: a string.
the mime type to provide the data in
Passed: a <GOutputStream>.
the <GOutputStream> to write to
Passed: a 32-bit integer.
I/O priority of the request.
Passed, or left out: a <GCancellable>, or
#f.
optional <GCancellable> object, #f
to ignore.
Passed, or left out: a procedure, or #f.
callback to call when the request is satisfied
See GAsyncReadyCallback for how it
is called.
Not passed: guile-gi supplies it.
the data to pass to callback function
Finishes an asynchronous write operation.
See content-provider:write-mime-type-async.
To override it in a new class, give register-type #:vfuncs
`((write-mime-type-finish . ,procedure)). The procedure is called as
(procedure self result) ⇒ %return.
Passed: the class whose implementation to call:
<GdkContentProvider>, or a class that
derives from it, or its GType number.
Passed: a <GdkContentProvider>.
Passed: a <GAsyncResult>.
Returned: a boolean.
#t if the operation was completed successfully. Otherwise
error will be set to describe the failure.