#[repr(transparent)]
pub struct SelectionData { /* private fields */ }

Implementations

Retrieves the data type of the selection.

Returns

the data type of the selection.

Retrieves the display of the selection.

Returns

the display of the selection.

Retrieves the format of the selection.

Returns

the format of the selection.

Retrieves the length of the raw data of the selection.

Returns

the length of the data of the selection.

Gets the contents of the selection data as a gdk_pixbuf::Pixbuf.

Returns

if the selection data contained a recognized image type and it could be converted to a gdk_pixbuf::Pixbuf, a newly allocated pixbuf is returned, otherwise None. If the result is non-None it must be freed with g_object_unref().

Retrieves the selection gdk::Atom of the selection data.

Returns

the selection gdk::Atom of the selection data.

Retrieves the target of the selection.

Returns

the target of the selection.

Gets the contents of self as an array of targets. This can be used to interpret the results of getting the standard TARGETS target that is always supplied for any selection.

Returns

true if self contains a valid array of targets, otherwise false.

targets

location to store an array of targets. The result stored here must be freed with g_free().

Gets the contents of the selection data as a UTF-8 string.

Returns

if the selection data contained a recognized text type and it could be converted to UTF-8, a newly allocated string containing the converted text, otherwise None. If the result is non-None it must be freed with g_free().

Gets the contents of the selection data as array of URIs.

Returns

if the selection data contains a list of URIs, a newly allocated None-terminated string array containing the URIs, otherwise None. If the result is non-None it must be freed with g_strfreev().

Stores new data into a SelectionData object. Should only be called from a selection handler callback. Zero-terminates the stored data.

type_

the type of selection data

format

format (number of bits in a unit)

data

pointer to the data (will be copied)

Sets the contents of the selection from a gdk_pixbuf::Pixbuf The pixbuf is converted to the form determined by self->target.

pixbuf

a gdk_pixbuf::Pixbuf

Returns

true if the selection was successfully set, otherwise false.

Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by self->target.

str

a UTF-8 string

len

the length of str, or -1 if str is nul-terminated.

Returns

true if the selection was successfully set, otherwise false.

Sets the contents of the selection from a list of URIs. The string is converted to the form determined by self->target.

uris

a None-terminated array of strings holding URIs

Returns

true if the selection was successfully set, otherwise false.

Given a SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a gdk_pixbuf::Pixbuf.

writable

whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format

Returns

true if self holds a list of targets, and a suitable target for images is included, otherwise false.

Given a SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide rich text.

buffer

a TextBuffer

Returns

true if self holds a list of targets, and a suitable target for rich text is included, otherwise false.

Given a SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text.

Returns

true if self holds a list of targets, and a suitable target for text is included, otherwise false.

Given a SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide a list or URIs.

Returns

true if self holds a list of targets, and a suitable target for URI lists is included, otherwise false.

Retrieves the raw data of the selection.

Returns

the raw data of the selection.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.