gtkmm 4.16.0
|
An icon, used with Gtk::IconTheme. More...
#include <gtkmm/iconpaintable.h>
Public Member Functions | |
IconPaintable (IconPaintable &&src) noexcept | |
IconPaintable & | operator= (IconPaintable &&src) noexcept |
~IconPaintable () noexcept override | |
GtkIconPaintable * | gobj () |
Provides access to the underlying C GObject. | |
const GtkIconPaintable * | gobj () const |
Provides access to the underlying C GObject. | |
GtkIconPaintable * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::RefPtr< Gio::File > | get_file () const |
Gets the Gio::File that was used to load the icon. | |
Glib::ustring | get_icon_name () const |
Get the icon name being used for this icon. | |
bool | is_symbolic () const |
Checks if the icon is symbolic or not. | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::File > > | property_file () const |
The file representing the icon, if any. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_icon_name () const |
The icon name that was chosen during lookup. | |
Glib::PropertyProxy_ReadOnly< bool > | property_is_symbolic () const |
Whether the icon is symbolic or not. | |
![]() | |
Paintable (Paintable &&src) noexcept | |
Paintable & | operator= (Paintable &&src) noexcept |
~Paintable () noexcept override | |
GdkPaintable * | gobj () |
Provides access to the underlying C GObject. | |
const GdkPaintable * | gobj () const |
Provides access to the underlying C GObject. | |
void | snapshot (const Glib::RefPtr< Gdk::Snapshot > & snapshot, double width, double height) |
Snapshots the given paintable with the given width and height. | |
Glib::RefPtr< const Paintable > | get_current_image () const |
Gets an immutable paintable for the current contents displayed by paintable. | |
Flags | get_flags () const |
Get flags for the paintable. | |
int | get_intrinsic_width () const |
Gets the preferred width the paintable would like to be displayed at. | |
int | get_intrinsic_height () const |
Gets the preferred height the paintable would like to be displayed at. | |
double | get_intrinsic_aspect_ratio () const |
Gets the preferred aspect ratio the paintable would like to be displayed at. | |
void | compute_concrete_size (double specified_width, double specified_height, double default_width, double default_height, double &concrete_width, double &concrete_height) const |
Compute a concrete size for the Gdk::Paintable . | |
void | invalidate_contents () |
Called by implementations of Gdk::Paintable to invalidate their contents. | |
void | invalidate_size () |
Called by implementations of Gdk::Paintable to invalidate their size. | |
Glib::SignalProxy< void()> | signal_invalidate_contents () |
Glib::SignalProxy< void()> | signal_invalidate_size () |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< IconPaintable > | create (const Glib::RefPtr< Gio::File > & file, int size, int scale=1) |
Creates a Gtk::IconPaintable for a file with a given size and scale. | |
![]() | |
static void | add_interface (GType gtype_implementer) |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::IconPaintable > | wrap (GtkIconPaintable *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
![]() | |
Glib::RefPtr< Gdk::Paintable > | wrap (GdkPaintable *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Additional Inherited Members | |
![]() | |
enum class | Flags { Flags::STATIC_SIZE = 1 << 0 , Flags::STATIC_CONTENTS = 1 << 1 } |
Flags about a paintable object. More... | |
![]() | |
Paintable () | |
You should derive from this class to use it. | |
virtual void | snapshot_vfunc (const Glib::RefPtr< Gdk::Snapshot > &snapshot, double width, double height) |
virtual Glib::RefPtr< Paintable > | get_current_image_vfunc () const |
virtual Flags | get_flags_vfunc () const |
virtual int | get_intrinsic_width_vfunc () const |
virtual int | get_intrinsic_height_vfunc () const |
virtual double | get_intrinsic_aspect_ratio_vfunc () const |
An icon, used with Gtk::IconTheme.
|
noexcept |
|
overridenoexcept |
|
static |
Creates a Gtk::IconPaintable
for a file with a given size and scale.
The icon can then be rendered by using it as a Gdk::Paintable
.
file | A Gio::File . |
size | Desired icon size, in application pixels. |
scale | The desired scale. |
Gtk::IconPaintable
containing for the icon. Unref with Glib::object_unref(). Glib::RefPtr< Gio::File > Gtk::IconPaintable::get_file | ( | ) | const |
Gets the Gio::File
that was used to load the icon.
Gio::File
for the icon. Glib::ustring Gtk::IconPaintable::get_icon_name | ( | ) | const |
Get the icon name being used for this icon.
When an icon looked up in the icon theme was not available, the icon theme may use fallback icons - either those specified to Gtk::IconTheme::lookup_icon() or the always-available "image-missing". The icon chosen is returned by this function.
If the icon was created without an icon theme, this function returns nullptr
.
nullptr
if its not a themed icon.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkIconPaintable * Gtk::IconPaintable::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gtk::IconPaintable::is_symbolic | ( | ) | const |
Checks if the icon is symbolic or not.
This currently uses only the file name and not the file contents for determining this. This behaviour may change in the future.
Note that to render a symbolic Gtk::IconPaintable
properly (with recoloring), you have to set its icon name on a Gtk::Image
.
true
if the icon is symbolic, false
otherwise.
|
noexcept |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::File > > Gtk::IconPaintable::property_file | ( | ) | const |
The file representing the icon, if any.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::IconPaintable::property_icon_name | ( | ) | const |
The icon name that was chosen during lookup.
Default value: ""
Glib::PropertyProxy_ReadOnly< bool > Gtk::IconPaintable::property_is_symbolic | ( | ) | const |
Whether the icon is symbolic or not.
Default value: false
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |