gio-0.12.0: Binding to the GIO.

Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net

System.GIO.Icons.Icon

Contents

Description

 

Synopsis

Details

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

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

To obtain a hash of a Icon, see iconHash.

To check if two Icons are equal, see iconEqual.

For serializing a Icon, use iconToString.

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

Types

newtype Icon Source

Constructors

Icon (ForeignPtr Icon) 

class GObjectClass o => IconClass o Source

Instances

Methods

iconEqualSource

Arguments

:: (IconClass icon1, IconClass icon2) 
=> icon1 
-> icon2 
-> IO Bool

returns True if icon1 is equal to icon2. False otherwise.

Checks if two icons are equal.

iconToString :: IconClass icon => icon -> IO ByteStringSource

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 iconNewForString to get icon back from the returned string.

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

  • If icon is a FileIcon, the returned string is a native path (such as pathto/my icon.png) without escaping if the File for icon is a native file. If the file is not native, the returned string is the result of fileGetUri.
  • If icon is a ThemedIcon with exactly one name, the encoding is simply the name (such as network-server).

iconNewForString :: ByteString -> IO IconSource

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

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