IconSet

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

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

Members

Functions

_cPtr
void* _cPtr(Flag!"Dup" dup)
addSource
void addSource(gtk.icon_source.IconSource source)

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

copy
gtk.icon_set.IconSet copy()

Copies icon_set by value.

getSizes
void getSizes(gtk.types.IconSize[] sizes)

Obtains a list of icon sizes this icon set can render. The returned array must be freed with glib.global.gfree.

renderIcon
gdkpixbuf.pixbuf.Pixbuf renderIcon(gtk.style.Style style, gtk.types.TextDirection direction, gtk.types.StateType state, gtk.types.IconSize size, gtk.widget.Widget widget, string detail)

Renders an icon using gtk.style.Style.renderIcon. In most cases, gtk.widget.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
gdkpixbuf.pixbuf.Pixbuf renderIconPixbuf(gtk.style_context.StyleContext context, gtk.types.IconSize size)

Renders an icon using gtk.global.renderIconPixbuf. In most cases, gtk.widget.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
cairo.surface.Surface renderIconSurface(gtk.style_context.StyleContext context, gtk.types.IconSize size, int scale, gdk.window.Window forWindow)

Renders an icon using gtk.global.renderIconPixbuf and converts it to a cairo surface.

self
IconSet self()

Returns this, for use in with statements.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
newFromPixbuf
gtk.icon_set.IconSet newFromPixbuf(gdkpixbuf.pixbuf.Pixbuf pixbuf)

Creates a new #GtkIconSet with pixbuf as the default/fallback source image. If you don’t add any additional #GtkIconSource 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.

Inherited Members

From Boxed

_cInstancePtr
void* _cInstancePtr;

Pointer to the C boxed value

_getGType
GType _getGType()

Get the GType of this boxed type.

_gType
GType _gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

boxCopy
void* boxCopy()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.