Package org.gnome.gio

Interface Icon

All Superinterfaces:
Proxy
All Known Subinterfaces:
LoadableIcon
All Known Implementing Classes:
BytesIcon, DmabufTexture, Emblem, EmblemedIcon, FileIcon, GLTexture, Icon.IconImpl, LoadableIcon.LoadableIconImpl, MemoryTexture, Pixbuf, Texture, Texture.TextureImpl, ThemedIcon

@Generated("io.github.jwharm.JavaGI") public interface Icon extends Proxy
GIcon is a very minimal interface for icons. It provides functions for checking the equality of two icons, hashing of icons and serializing an icon to and from strings.

GIcon does not provide the actual pixmap for the icon as this is out of GIO's scope, however implementations of GIcon may contain the name of an icon (see ThemedIcon), or the path to an icon (see LoadableIcon).

To obtain a hash of a GIcon, see hash().

To check if two GIcons are equal, see equal(org.gnome.gio.Icon).

For serializing a GIcon, use serialize() and deserialize(org.gnome.glib.Variant).

If you want to consume GIcon (for example, in a toolkit) you must be prepared to handle at least the three following cases: LoadableIcon, ThemedIcon and EmblemedIcon. It may also make sense to have fast-paths for other cases (like handling GdkPixbuf directly, for example) but all compliant GIcon implementations outside of GIO must implement LoadableIcon.

If your application or library provides one or more GIcon implementations you need to ensure that your new implementation also implements LoadableIcon. Additionally, you must provide an implementation of serialize() that gives a result that is understood by deserialize(org.gnome.glib.Variant), yielding one of the built-in icon types.