[]Struct gtk::SelectionData

pub struct SelectionData(_);

Implementations

impl SelectionData[src]

pub fn get_data_type(&self) -> Atom[src]

Retrieves the data type of the selection.

Returns

the data type of the selection.

pub fn get_display(&self) -> Option<Display>[src]

Retrieves the display of the selection.

Returns

the display of the selection.

pub fn get_format(&self) -> i32[src]

Retrieves the format of the selection.

Returns

the format of the selection.

pub fn get_length(&self) -> i32[src]

Retrieves the length of the raw data of the selection.

Returns

the length of the data of the selection.

pub fn get_pixbuf(&self) -> Option<Pixbuf>[src]

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 gobject::ObjectExt::unref.

pub fn get_selection(&self) -> Atom[src]

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

Returns

the selection gdk::Atom of the selection data.

pub fn get_target(&self) -> Atom[src]

Retrieves the target of the selection.

Returns

the target of the selection.

pub fn get_targets(&self) -> Option<Vec<Atom>>[src]

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.

targets

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

n_atoms

location to store number of items in targets.

Returns

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

pub fn get_text(&self) -> Option<GString>[src]

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.

pub fn get_uris(&self) -> Vec<GString>[src]

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.

pub fn set(&self, type_: &Atom, format: i32, data: &[u8])[src]

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)

length

length of the data

pub fn set_pixbuf(&self, pixbuf: &Pixbuf) -> bool[src]

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.

pub fn set_text(&self, str: &str) -> bool[src]

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.

pub fn set_uris(&self, uris: &[&str]) -> bool[src]

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.

pub fn targets_include_image(&self, writable: bool) -> bool[src]

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.

pub fn targets_include_rich_text<P: IsA<TextBuffer>>(&self, buffer: &P) -> bool[src]

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.

pub fn targets_include_text(&self) -> bool[src]

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.

pub fn targets_include_uri(&self) -> bool[src]

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.

impl SelectionData[src]

pub fn get_data(&self) -> Vec<u8>[src]

Retrieves the raw data of the selection.

Returns

the raw data of the selection.

Trait Implementations

impl Clone for SelectionData

impl Debug for SelectionData[src]

impl Eq for SelectionData[src]

impl Hash for SelectionData[src]

impl Ord for SelectionData[src]

impl PartialEq<SelectionData> for SelectionData[src]

impl PartialOrd<SelectionData> for SelectionData[src]

impl StaticType for SelectionData

impl StructuralEq for SelectionData[src]

impl StructuralPartialEq for SelectionData[src]

Auto Trait Implementations

impl RefUnwindSafe for SelectionData

impl !Send for SelectionData

impl !Sync for SelectionData

impl Unpin for SelectionData

impl UnwindSafe for SelectionData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.