IconSet

Constructors

this
this(GtkIconSet* gtkIconSet, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gtk.IconSet A gtk.IconSet represents a single icon in various sizes and widget states. It can provide a gdk.Pixbuf for a given size and state on request, and automatically caches some of the rendered gdk.Pixbuf objects.

this
this(Pixbuf pixbuf)

Creates a new gtk.IconSet with pixbuf as the default/fallback source image. If you don’t add any additional gtk.IconSource to the icon set, all variants of the icon will be created from pixbuf, using scaling, pixelation, etc. as required to adjust the icon size or make the icon look insensitive/prelighted.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

addSource
void addSource(IconSource source)

Icon sets have a list of gtk.IconSource, which they use as base icons for rendering icons in different states and sizes. Icons are scaled, made to look insensitive, etc. in IconSet.renderIcon, but gtk.IconSet needs base images to work with. The base images and when to use them are described by a gtk.IconSource

copy
IconSet copy()

Copies icon_set by value.

getIconSetStruct
GtkIconSet* getIconSetStruct(bool transferOwnership)

Get the main Gtk struct

getSizes
void getSizes(GtkIconSize[] sizes)

Obtains a list of icon sizes this icon set can render. The returned array must be freed with g_free().

getStruct
void* getStruct()

the main Gtk struct as a void*

ref_
IconSet ref_()

Increments the reference count on icon_set.

renderIcon
Pixbuf renderIcon(Style style, GtkTextDirection direction, GtkStateType state, GtkIconSize size, Widget widget, string detail)

Renders an icon using Style.renderIcon. In most cases, Widget.renderIcon is better, since it automatically provides most of the arguments from the current widget settings. This function never returns NULL; if the icon can’t be rendered (perhaps because an image file fails to load), a default "missing image" icon will be returned instead.

renderIconPixbuf
Pixbuf renderIconPixbuf(StyleContext context, GtkIconSize size)

Renders an icon using gtk_render_icon_pixbuf(). In most cases, Widget.renderIconPixbuf is better, since it automatically provides most of the arguments from the current widget settings. This function never returns NULL; if the icon can’t be rendered (perhaps because an image file fails to load), a default "missing image" icon will be returned instead.

renderIconSurface
Surface renderIconSurface(StyleContext context, GtkIconSize size, int scale, Window forWindow)

Renders an icon using gtk_render_icon_pixbuf() and converts it to a cairo surface.

unref
void unref()

Decrements the reference count on icon_set, and frees memory if the reference count reaches 0.

Static functions

getType
GType getType()

Variables

gtkIconSet
GtkIconSet* gtkIconSet;

the main Gtk struct