package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Icon

type t = [ `icon ] Gobject.obj
val from_gobject : 'a Gobject.obj -> t
val to_string : t -> string option

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 #GIcon except in the following two cases

  • If @icon is a #GFileIcon, the returned string is a native path (such as `/path/to/my icon.png`) without escaping if the #GFile for @icon is a native file. If the file is not native, the returned string is the result of g_file_get_uri() (such as `sftp://path/to/my%20icon.png`).
  • If @icon is a #GThemedIcon with exactly one name and no fallbacks, the encoding is simply the name (such as `network-server`).
val serialize : t -> Gvariant.t option

Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved back by calling g_icon_deserialize() on the returned value. As serialization will avoid using raw icon data when possible, it only makes sense to transfer the #GVariant between processes on the same machine, (as opposed to over the network), and within the same file system namespace.

val hash : t -> int

Gets a hash for an icon.

val equal : t -> t option -> bool

Checks if two icons are equal.