Class: Gdk::ContentProvider
- Inherits:
-
Object
- Object
- Gdk::ContentProvider
- Defined in:
- (unknown)
Overview
Class structure for GdkContentProvider.
Instance Method Summary collapse
-
#content_changed ⇒ nil
Emits the ::content-changed signal.
-
#formats ⇒ Gdk::ContentFormats
The possible formats that the provider can provide its data in.
-
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the provider can provide its data in.
-
#get_value(value) ⇒ Boolean
Gets the contents of provider stored in value.
-
#initialize(providers, n_providers) ⇒ Gdk::ContentProvider
constructor
Creates a content provider that represents all the given providers.
-
#ref_formats ⇒ Gdk::ContentFormats
Gets the formats that the provider can provide its current contents in.
-
#ref_storable_formats ⇒ Gdk::ContentFormats
Gets the formats that the provider suggests other applications to store the data in.
-
#storable_formats ⇒ Gdk::ContentFormats
The subset of formats that clipboard managers should store this provider's data in.
-
#storable_formats=(storable_formats) ⇒ Gdk::ContentFormats
The subset of formats that clipboard managers should store this provider's data in.
-
#write_mime_type_async(mime_type, stream, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously writes the contents of provider to stream in the given mime_type.
-
#write_mime_type_finish(result) ⇒ Boolean
Finishes an asynchronous write operation.
Constructor Details
#initialize(providers, n_providers) ⇒ Gdk::ContentProvider
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);
Instance Method Details
#content_changed ⇒ nil
Emits the ::content-changed signal.
#formats ⇒ Gdk::ContentFormats
The possible formats that the provider can provide its data in.
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the provider can provide its data in.
#get_value(value) ⇒ Boolean
Gets the contents of provider 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 [methodGdk.ContentProvider.ref_formats]. However, if the
given GType is not supported, this operation can fail and
G_IO_ERROR_NOT_SUPPORTED will be reported.
#ref_formats ⇒ Gdk::ContentFormats
Gets the formats that the provider can provide its current contents in.
#ref_storable_formats ⇒ Gdk::ContentFormats
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 [methodGdk.ContentProvider.ref_formats].
#storable_formats ⇒ Gdk::ContentFormats
The subset of formats that clipboard managers should store this provider's data in.
#storable_formats=(storable_formats) ⇒ Gdk::ContentFormats
The subset of formats that clipboard managers should store this provider's data in.
#write_mime_type_async(mime_type, stream, io_priority, cancellable, callback, user_data) ⇒ nil
Asynchronously writes the contents of provider to stream in the given mime_type.
When the operation is finished callback will be called. You must then call [methodGdk.ContentProvider.write_mime_type_finish] to get the result of the operation.
The given mime type does not need to be listed in the formats returned by
[methodGdk.ContentProvider.ref_formats]. However, if the given GType is
not supported, G_IO_ERROR_NOT_SUPPORTED will be reported.
The given stream will not be closed.
#write_mime_type_finish(result) ⇒ Boolean
Finishes an asynchronous write operation.
See [methodGdk.ContentProvider.write_mime_type_async].