GIcon

## GIcon GIcon — Interface for icons |

## Synopsis

    #include <gio/gio.h>

                        GIcon;
                        GIconIface;
    guint               g_icon_hash                         (gconstpointer icon);
    gboolean            g_icon_equal                        (GIcon *icon1,
                                                             GIcon *icon2);

## Object Hierarchy

      GInterface
       +----GIcon

## Prerequisites

GIcon requires GObject.

## Known Derived Interfaces

GIcon is required by GLoadableIcon.

## Known Implementations

GIcon is implemented by GThemedIcon, GFileIcon, GEmblem and GEmblemedIcon.

## Description

GIcon is a very minimal interface for icons. It provides functions for checking the equality of two icons and hashing of icons.

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 GThemedIcon), or the path to an icon (see GLoadableIcon).

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

To check if two GIcons are equal, see `g_icon_equal()`.

## Details

### GIcon

    typedef struct _GIcon GIcon;

An abstract type that specifies an icon.

### GIconIface

    typedef struct {
      GTypeInterface g_iface;

      /* Virtual Table */

      guint    (* hash)  (GIcon *icon);
      gboolean (* equal) (GIcon *icon1,
                          GIcon *icon2);
    } GIconIface;

GIconIface is used to implement GIcon types for various different systems. See GThemedIcon and GLoadableIcon for examples of how to implement this interface.

GTypeInterface `g_iface`; | The parent interface.
`hash` () | A hash for a given GIcon.
`equal` () | Checks if two GIcons are equal.

### g_icon_hash ()

    guint               g_icon_hash                         (gconstpointer icon);

Gets a hash for an icon.

`icon` : | gconstpointer to an icon object.
Returns : | a guint containing a hash for the `icon`, suitable for use in a GHashTable or similar data structure.

### g_icon_equal ()

    gboolean            g_icon_equal                        (GIcon *icon1,
                                                             GIcon *icon2);

Checks if two icons are equal.

`icon1` : | pointer to the first GIcon.
`icon2` : | pointer to the second GIcon.
Returns : | `TRUE` if `icon1` is equal to `icon2`. `FALSE` otherwise.