gio-0.13.12.0: Binding to GIO

Maintainer | gtk2hs-devel@lists.sourceforge.net
Stability | alpha
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

System.GIO.Icons.Icon

Contents

- Details
- Types
- Methods

Description

Synopsis

- newtype Icon = Icon (ForeignPtr Icon)
- class GObjectClass o => IconClass o
- iconEqual :: (IconClass icon1, IconClass icon2) => icon1 -> icon2 -> IO Bool
- iconToString :: IconClass icon => icon -> IO ByteString
- iconNewForString :: ByteString -> IO Icon

# 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 `Icon`s 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) |

#### Instances

Instances details

Eq Icon Source # |
Instance details Defined in System.GIO.Types Methods (==) :: Icon -> Icon -> Bool Source # (/=) :: Icon -> Icon -> Bool Source #
Ord Icon Source # |
Instance details Defined in System.GIO.Types Methods compare :: Icon -> Icon -> Ordering Source # (<) :: Icon -> Icon -> Bool Source # (<=) :: Icon -> Icon -> Bool Source # (>) :: Icon -> Icon -> Bool Source # (>=) :: Icon -> Icon -> Bool Source # max :: Icon -> Icon -> Icon Source # min :: Icon -> Icon -> Icon Source #
IconClass Icon Source # |
Instance details Defined in System.GIO.Types
GObjectClass Icon Source # |
Instance details Defined in System.GIO.Types Methods toGObject :: Icon -> GObject Source # unsafeCastGObject :: GObject -> Icon Source #

class GObjectClass o => IconClass o Source #

#### Instances

Instances details

IconClass Icon Source # |
Instance details Defined in System.GIO.Types

# Methods

iconEqual Source #

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 ByteString Source #

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 Icon Source #

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