W Wrapl, The Programming Language

Libraries:Gtk:Gio:GIcon

Types

T

T 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.

T does not provide the actual pixmap for the icon as this is out of GIO's scope, however implementations of T may contain the name of an icon (see Gtk.Gio.GThemedIcon.T), or the path to an icon (see Gtk.Gio.GLoadableIcon.T).

To obtain a hash of a T, see Hash.

To check if two GIcons are equal, see Equal.

For serializing a T, use ToString and g_icon_new_for_string().

If your application or library provides one or more T implementations you need to ensure that each GType is registered with the type system prior to calling g_icon_new_for_string().



ParentT

Constants

InterfaceInfo : Std.Object.T

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Hash(icon @ Std.Address.T) : Std.Integer.SmallT

Gets a hash for an icon.

Virtual: hash

icon gconstpointer to an icon object.
Returns a guint containing a hash for the icon, suitable for use in a Gtk.Glib.GHashTable.T or similar data structure.


NewForString(str @ Std.String.T, error @ Std.Object.T) : Gtk.Gio.GIcon.T

Generate a T instance from str. This function can fail if str is not valid - see ToString for discussion.

If your application or library provides one or more T implementations you need to ensure that each GType is registered with the type system prior to calling g_icon_new_for_string().

str A string obtained via ToString.
error Return location for error.
Returns An object implementing the T interface or NULL if error is set. [transfer full]


Methods

:Equal(self @ T, icon2 @ Gtk.Gio.GIcon.T) : Std.Symbol.T

Checks if two icons are equal.

icon1 pointer to the first T.
icon2 pointer to the second T.
Returns TRUE if icon1 is equal to icon2. FALSE otherwise.


:Equal(_ @ ParentT, _ @ Gtk.Gio.GIcon.T)

:Hash(_ @ ParentT)

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

Generates a textual representation of icon that can be used for serialization such as when passing icon to a different process or saving it to persistent storage. Use g_icon_new_for_string() to get icon back from the returned string.

The encoding of the returned string is proprietary to T except in the following two cases

  • If icon is a Gtk.Gio.GFileIcon.T, the returned string is a native path (such as /path/to/my icon.png) without escaping if the Gtk.Gio.GFile.T for icon is a native file. If the file is not native, the returned string is the result of Gtk.Gio.GFile.GetUri (such as sftp://path/to/my%20icon.png).

  • If icon is a Gtk.Gio.GThemedIcon.T with exactly one name, the encoding is simply the name (such as network-server).