W Wrapl, The Programming Language

Libraries:Gtk:Gtk:IconSource

Types

T

Constants

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



New() : Gtk.Gtk.IconSource.T

Creates a new T. A T contains a Gtk.Gdk.Pixbuf.T (or image filename) that serves as the base image for one or more of the icons in a Gtk.Gtk.IconSet.T, along with a specification for which icons in the icon set will be based on that pixbuf or image file. An icon set contains a set of icons that represent "the same" logical concept in different states, different global text directions, and different sizes.

So for example a web browser's "Back to Previous Page" icon might point in a different direction in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon. Gtk.Gtk.IconSet.T contains a list of T from which it can derive specific icon variants in the set.

In the simplest case, Gtk.Gtk.IconSet.T contains one source pixbuf from which it derives all variants. The convenience function gtk_icon_set_new_from_pixbuf() handles this case; if you only have one source pixbuf, just use that function.

If you want to use a different base pixbuf for different icon variants, you create multiple icon sources, mark which variants they'll be used to create, and add them to the icon set with Gtk.Gtk.IconSet.AddSource.

By default, the icon source has all parameters wildcarded. That is, the icon source will be used as the base icon for any desired text direction, widget state, or icon size.

Returns a new T


Methods

:"="(_ @ T, _ @ T)

:Copy(self @ T) : Gtk.Gtk.IconSource.T

Creates a copy of source; mostly useful for language bindings.

source a T
Returns a new T


:Free(self @ T) : Std.Object.T

Frees a dynamically-allocated icon source, along with its filename, size, and pixbuf fields if those are not NULL.

source a T


:GetDirection(self @ T) : Gtk.Gtk.TextDirection.T

Obtains the text direction this icon source applies to. The return value is only useful/meaningful if the text direction is not wildcarded.

source a T
Returns text direction this source matches


:GetDirectionWildcarded(self @ T) : Std.Symbol.T

Gets the value set by SetDirectionWildcarded.

source a T
Returns TRUE if this icon source is a base for any text direction variant


:GetFilename(self @ T) : Std.String.T



:GetIconName(self @ T) : Std.String.T

Retrieves the source icon name, or NULL if none is set. The icon_name is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

source a T
Returns icon name. This string must not be modified or freed.


:GetPixbuf(self @ T) : Gtk.Gdk.Pixbuf.T

Retrieves the source pixbuf, or NULL if none is set. In addition, if a filename source is in use, this function in some cases will return the pixbuf from loaded from the filename. This is, for example, true for the GtkIconSource passed to the GtkStyle::render_icon() virtual function. The reference count on the pixbuf is not incremented.

source a T
Returns source pixbuf. [transfer none]


:GetSize(self @ T) : Gtk.Gtk.IconSize.T

Obtains the icon size this source applies to. The return value is only useful/meaningful if the icon size is not wildcarded.

source a T
Returns icon size this source matches. [type int]


:GetSizeWildcarded(self @ T) : Std.Symbol.T

Gets the value set by SetSizeWildcarded.

source a T
Returns TRUE if this icon source is a base for any icon size variant


:GetState(self @ T) : Gtk.Gtk.StateType.T

Obtains the widget state this icon source applies to. The return value is only useful/meaningful if the widget state is not wildcarded.

source a T
Returns widget state this source matches


:GetStateWildcarded(self @ T) : Std.Symbol.T

Gets the value set by SetStateWildcarded.

source a T
Returns TRUE if this icon source is a base for any widget state variant


:SetDirection(self @ T, direction @ Gtk.Gtk.TextDirection.T) : Std.Object.T

Sets the text direction this icon source is intended to be used with.

Setting the text direction on an icon source makes no difference if the text direction is wildcarded. Therefore, you should usually call SetDirectionWildcarded to un-wildcard it in addition to calling this function.

source a T
direction text direction this source applies to


:SetDirectionWildcarded(self @ T, setting @ Std.Symbol.T) : Std.Object.T

If the text direction is wildcarded, this source can be used as the base image for an icon in any Gtk.Gtk.TextDirection.T. If the text direction is not wildcarded, then the text direction the icon source applies to should be set with SetDirection, and the icon source will only be used with that text direction.

Gtk.Gtk.IconSet.T prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

source a T
setting TRUE to wildcard the text direction


:SetFilename(self @ T, filename @ Std.String.T) : Std.Object.T



:SetIconName(self @ T, icon_name @ Std.String.T) : Std.Object.T

Sets the name of an icon to look up in the current icon theme to use as a base image when creating icon variants for Gtk.Gtk.IconSet.T.

source a T
icon_name name of icon to use. [allow-none]


:SetPixbuf(self @ T, pixbuf @ Gtk.Gdk.Pixbuf.T) : Std.Object.T

Sets a pixbuf to use as a base image when creating icon variants for Gtk.Gtk.IconSet.T.

source a T
pixbuf pixbuf to use as a source


:SetSize(self @ T, size @ Gtk.Gtk.IconSize.T) : Std.Object.T

Sets the icon size this icon source is intended to be used with.

Setting the icon size on an icon source makes no difference if the size is wildcarded. Therefore, you should usually call SetSizeWildcarded to un-wildcard it in addition to calling this function.

source a T
size icon size this source applies to. [type int]


:SetSizeWildcarded(self @ T, setting @ Std.Symbol.T) : Std.Object.T

If the icon size is wildcarded, this source can be used as the base image for an icon of any size. If the size is not wildcarded, then the size the source applies to should be set with SetSize and the icon source will only be used with that specific size.

Gtk.Gtk.IconSet.T prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

Gtk.Gtk.IconSet.T will normally scale wildcarded source images to produce an appropriate icon at a given size, but will not change the size of source images that match exactly.

source a T
setting TRUE to wildcard the widget state


:SetState(self @ T, state @ Gtk.Gtk.StateType.T) : Std.Object.T

Sets the widget state this icon source is intended to be used with.

Setting the widget state on an icon source makes no difference if the state is wildcarded. Therefore, you should usually call SetStateWildcarded to un-wildcard it in addition to calling this function.

source a T
state widget state this source applies to


:SetStateWildcarded(self @ T, setting @ Std.Symbol.T) : Std.Object.T

If the widget state is wildcarded, this source can be used as the base image for an icon in any Gtk.Gtk.StateType.T. If the widget state is not wildcarded, then the state the source applies to should be set with SetState and the icon source will only be used with that specific state.

Gtk.Gtk.IconSet.T prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

Gtk.Gtk.IconSet.T will normally transform wildcarded source images to produce an appropriate icon for a given state, for example lightening an image on prelight, but will not modify source images that match exactly.

source a T
setting TRUE to wildcard the widget state


:"~="(_ @ T, _ @ T)