pub trait ImageExt:
IsA<Image>
+ Sealed
+ 'static {
Show 38 methods
// Provided methods
fn clear(&self) { ... }
fn animation(&self) -> Option<PixbufAnimation> { ... }
fn gicon(&self) -> (Icon, IconSize) { ... }
fn pixbuf(&self) -> Option<Pixbuf> { ... }
fn pixel_size(&self) -> i32 { ... }
fn storage_type(&self) -> ImageType { ... }
fn set_from_animation(&self, animation: &impl IsA<PixbufAnimation>) { ... }
fn set_from_file(&self, filename: Option<impl AsRef<Path>>) { ... }
fn set_from_gicon(&self, icon: &impl IsA<Icon>, size: IconSize) { ... }
fn set_from_icon_name(&self, icon_name: Option<&str>, size: IconSize) { ... }
fn set_from_pixbuf(&self, pixbuf: Option<&Pixbuf>) { ... }
fn set_from_resource(&self, resource_path: Option<&str>) { ... }
fn set_from_surface(&self, surface: Option<&Surface>) { ... }
fn set_pixel_size(&self, pixel_size: i32) { ... }
fn file(&self) -> Option<GString> { ... }
fn set_file(&self, file: Option<&str>) { ... }
fn set_gicon<P: IsA<Icon>>(&self, gicon: Option<&P>) { ... }
fn icon_name(&self) -> Option<GString> { ... }
fn set_icon_name(&self, icon_name: Option<&str>) { ... }
fn set_pixbuf(&self, pixbuf: Option<&Pixbuf>) { ... }
fn pixbuf_animation(&self) -> Option<PixbufAnimation> { ... }
fn set_pixbuf_animation<P: IsA<PixbufAnimation>>(
&self,
pixbuf_animation: Option<&P>,
) { ... }
fn resource(&self) -> Option<GString> { ... }
fn set_resource(&self, resource: Option<&str>) { ... }
fn surface(&self) -> Option<Surface> { ... }
fn set_surface(&self, surface: Option<&Surface>) { ... }
fn uses_fallback(&self) -> bool { ... }
fn set_use_fallback(&self, use_fallback: bool) { ... }
fn connect_file_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_gicon_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_icon_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_pixbuf_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_pixbuf_animation_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_pixel_size_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_resource_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_storage_type_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_surface_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_use_fallback_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methods§
Sourcefn animation(&self) -> Option<PixbufAnimation>
fn animation(&self) -> Option<PixbufAnimation>
Gets the gdk_pixbuf::PixbufAnimation being displayed by the Image.
The storage type of the image must be ImageType::Empty or
ImageType::Animation (see storage_type()).
The caller of this function does not own a reference to the
returned animation.
§Returns
the displayed animation, or None if
the image is empty
Sourcefn gicon(&self) -> (Icon, IconSize)
fn gicon(&self) -> (Icon, IconSize)
Gets the gio::Icon and size being displayed by the Image.
The storage type of the image must be ImageType::Empty or
ImageType::Gicon (see storage_type()).
The caller of this function does not own a reference to the
returned gio::Icon.
§Returns
§gicon
place to store a
gio::Icon, or None
§size
Sourcefn pixbuf(&self) -> Option<Pixbuf>
fn pixbuf(&self) -> Option<Pixbuf>
Gets the gdk_pixbuf::Pixbuf being displayed by the Image.
The storage type of the image must be ImageType::Empty or
ImageType::Pixbuf (see storage_type()).
The caller of this function does not own a reference to the
returned pixbuf.
§Returns
the displayed pixbuf, or None if
the image is empty
Sourcefn pixel_size(&self) -> i32
fn pixel_size(&self) -> i32
Sourcefn storage_type(&self) -> ImageType
fn storage_type(&self) -> ImageType
Gets the type of representation being used by the Image
to store image data. If the Image has no image data,
the return value will be ImageType::Empty.
§Returns
image representation being used
Sourcefn set_from_animation(&self, animation: &impl IsA<PixbufAnimation>)
fn set_from_animation(&self, animation: &impl IsA<PixbufAnimation>)
Sourcefn set_from_file(&self, filename: Option<impl AsRef<Path>>)
fn set_from_file(&self, filename: Option<impl AsRef<Path>>)
Sourcefn set_from_gicon(&self, icon: &impl IsA<Icon>, size: IconSize)
fn set_from_gicon(&self, icon: &impl IsA<Icon>, size: IconSize)
Sourcefn set_from_icon_name(&self, icon_name: Option<&str>, size: IconSize)
fn set_from_icon_name(&self, icon_name: Option<&str>, size: IconSize)
See Image::from_icon_name() for details.
§icon_name
an icon name or None
§size
an icon size (IconSize)
Sourcefn set_from_pixbuf(&self, pixbuf: Option<&Pixbuf>)
fn set_from_pixbuf(&self, pixbuf: Option<&Pixbuf>)
Sourcefn set_from_resource(&self, resource_path: Option<&str>)
fn set_from_resource(&self, resource_path: Option<&str>)
Sourcefn set_from_surface(&self, surface: Option<&Surface>)
fn set_from_surface(&self, surface: Option<&Surface>)
Sourcefn set_pixel_size(&self, pixel_size: i32)
fn set_pixel_size(&self, pixel_size: i32)
Sets the pixel size to use for named icons. If the pixel size is set
to a value != -1, it is used instead of the icon size set by
set_from_icon_name().
§pixel_size
the new pixel size
fn file(&self) -> Option<GString>
fn set_file(&self, file: Option<&str>)
Sourcefn set_gicon<P: IsA<Icon>>(&self, gicon: Option<&P>)
fn set_gicon<P: IsA<Icon>>(&self, gicon: Option<&P>)
The GIcon displayed in the GtkImage. For themed icons, If the icon theme is changed, the image will be updated automatically.
Sourcefn icon_name(&self) -> Option<GString>
fn icon_name(&self) -> Option<GString>
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.
Sourcefn set_icon_name(&self, icon_name: Option<&str>)
fn set_icon_name(&self, icon_name: Option<&str>)
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.
fn set_pixbuf(&self, pixbuf: Option<&Pixbuf>)
fn pixbuf_animation(&self) -> Option<PixbufAnimation>
fn set_pixbuf_animation<P: IsA<PixbufAnimation>>( &self, pixbuf_animation: Option<&P>, )
Sourcefn set_resource(&self, resource: Option<&str>)
fn set_resource(&self, resource: Option<&str>)
A path to a resource file to display.
fn surface(&self) -> Option<Surface>
fn set_surface(&self, surface: Option<&Surface>)
Sourcefn uses_fallback(&self) -> bool
fn uses_fallback(&self) -> bool
Whether the icon displayed in the GtkImage will use
standard icon names fallback. The value of this property
is only relevant for images of type ImageType::IconName
and ImageType::Gicon.
Sourcefn set_use_fallback(&self, use_fallback: bool)
fn set_use_fallback(&self, use_fallback: bool)
Whether the icon displayed in the GtkImage will use
standard icon names fallback. The value of this property
is only relevant for images of type ImageType::IconName
and ImageType::Gicon.
fn connect_file_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_pixbuf_animation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_pixel_size_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_resource_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_storage_type_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_surface_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_use_fallback_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".