[−]Struct gtk::SelectionData
Implementations
impl SelectionData
[src]
pub fn get_data_type(&self) -> Atom
[src]
pub fn get_display(&self) -> Option<Display>
[src]
pub fn get_format(&self) -> i32
[src]
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]
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]
Trait Implementations
impl Clone for SelectionData
fn clone(&self) -> SelectionData
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SelectionData
[src]
impl Eq for SelectionData
[src]
impl Hash for SelectionData
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for SelectionData
[src]
fn cmp(&self, other: &SelectionData) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SelectionData> for SelectionData
[src]
fn eq(&self, other: &SelectionData) -> bool
[src]
fn ne(&self, other: &SelectionData) -> bool
[src]
impl PartialOrd<SelectionData> for SelectionData
[src]
fn partial_cmp(&self, other: &SelectionData) -> Option<Ordering>
[src]
fn lt(&self, other: &SelectionData) -> bool
[src]
fn le(&self, other: &SelectionData) -> bool
[src]
fn gt(&self, other: &SelectionData) -> bool
[src]
fn ge(&self, other: &SelectionData) -> bool
[src]
impl StaticType for SelectionData
fn static_type() -> Type
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToSendValue for T where
T: ToValue + SetValue + Send + ?Sized,
T: ToValue + SetValue + Send + ?Sized,
fn to_send_value(&self) -> SendValue
impl<T> ToValue for T where
T: SetValue + ?Sized,
T: SetValue + ?Sized,
fn to_value(&self) -> Value
fn to_value_type(&self) -> Type
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,