gi-gio-2.0.38: Gio bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gio.Objects.ThemedIcon

Contents

- Exported types
- Methods
  - appendName
  - getNames
  - new
  - newFromNames
  - newWithDefaultFallbacks
  - prependName
- Properties
  - name
  - names
  - useDefaultFallbacks

Description

`GThemedIcon` is an implementation of `Icon` that supports icon themes.

`GThemedIcon` contains a list of all of the icons present in an icon theme, so that icons can be looked up quickly. `GThemedIcon` does not provide actual pixmaps for icons, just the icon names. Ideally something like `Gtk.IconTheme.choose_icon()` should be used to resolve the list of names so that fallback icons work nicely with themes that inherit other themes.

Synopsis

- newtype ThemedIcon = ThemedIcon (ManagedPtr ThemedIcon)
- class (GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o
- toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon
- themedIconAppendName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- themedIconGetNames :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> m [Text]
- themedIconNew :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconNewFromNames :: (HasCallStack, MonadIO m) => [Text] -> m ThemedIcon
- themedIconNewWithDefaultFallbacks :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconPrependName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- constructThemedIconName :: (IsThemedIcon o, MonadIO m) => Text -> m (GValueConstruct o)
- constructThemedIconNames :: (IsThemedIcon o, MonadIO m) => [Text] -> m (GValueConstruct o)
- getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text]
- constructThemedIconUseDefaultFallbacks :: (IsThemedIcon o, MonadIO m) => Bool -> m (GValueConstruct o)
- getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool

# Exported types

newtype ThemedIcon Source #

Memory-managed wrapper type.

Constructors

ThemedIcon (ManagedPtr ThemedIcon) |

#### Instances

Instances details

Eq ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon Methods (==) :: ThemedIcon -> ThemedIcon -> Bool Source # (/=) :: ThemedIcon -> ThemedIcon -> Bool Source #
GObject ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon
ManagedPtrNewtype ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon Methods toManagedPtr :: ThemedIcon -> ManagedPtr ThemedIcon Source #
TypedObject ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon Methods glibType :: IO GType Source #
HasParentTypes ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon
IsGValue (Maybe ThemedIcon) Source # | Convert `ThemedIcon` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gio.Objects.ThemedIcon Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ThemedIcon -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ThemedIcon) Source #
type ParentTypes ThemedIcon Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon type ParentTypes ThemedIcon = '[Object, Icon]

class (GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o Source #

Type class for types which can be safely cast to `ThemedIcon`, for instance with `toThemedIcon`.

#### Instances

Instances details

(GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o Source # |
Instance details Defined in GI.Gio.Objects.ThemedIcon

toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon Source #

Cast to `ThemedIcon`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

appendName, bindProperty, bindPropertyFull, equal, forceFloating, freezeNotify, getv, hash, isFloating, notify, notifyByPspec, prependName, ref, refSink, runDispose, serialize, stealData, stealQdata, thawNotify, toString, unref, watchClosure.

#### Getters

getData, getNames, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## appendName

themedIconAppendName Source #

Arguments

:: (HasCallStack, MonadIO m, IsThemedIcon a) |
=> a | `icon`: a `ThemedIcon`
-> Text | `iconname`: name of icon to append to list of icons from within `icon`.
-> m () |

Append a name to the list of icons from within `icon`.

Note that doing so invalidates the hash computed by prior calls to `iconHash`.

## getNames

themedIconGetNames Source #

Arguments

:: (HasCallStack, MonadIO m, IsThemedIcon a) |
=> a | `icon`: a `ThemedIcon`.
-> m [Text] | Returns: a list of icon names.

Gets the names of icons from within `icon`.

## new

themedIconNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `iconname`: a string containing an icon name.
-> m ThemedIcon | Returns: a new `ThemedIcon`.

Creates a new themed icon for `iconname`.

## newFromNames

themedIconNewFromNames Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> [Text] | `iconnames`: an array of strings containing icon names.
-> m ThemedIcon | Returns: a new `ThemedIcon`

Creates a new themed icon for `iconnames`.

## newWithDefaultFallbacks

themedIconNewWithDefaultFallbacks Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `iconname`: a string containing an icon name
-> m ThemedIcon | Returns: a new `ThemedIcon`.

Creates a new themed icon for `iconname`, and all the names that can be created by shortening `iconname` at '-' characters.

In the following example, `icon1` and `icon2` are equivalent:

### C code

    const char *names[] = {
      "gnome-dev-cdrom-audio",
      "gnome-dev-cdrom",
      "gnome-dev",
      "gnome"
    };

    icon1 = g_themed_icon_new_from_names (names, 4);
    icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");

## prependName

themedIconPrependName Source #

Arguments

:: (HasCallStack, MonadIO m, IsThemedIcon a) |
=> a | `icon`: a `ThemedIcon`
-> Text | `iconname`: name of icon to prepend to list of icons from within `icon`.
-> m () |

Prepend a name to the list of icons from within `icon`.

Note that doing so invalidates the hash computed by prior calls to `iconHash`.

Since: 2.18

# Properties

## name

The icon name.

constructThemedIconName :: (IsThemedIcon o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`name`” property. This is rarely needed directly, but it is used by `new`.

## names

A `Nothing`-terminated array of icon names.

constructThemedIconNames :: (IsThemedIcon o, MonadIO m) => [Text] -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`names`” property. This is rarely needed directly, but it is used by `new`.

getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text] Source #

Get the value of the “`names`” property. When overloading is enabled, this is equivalent to

    get themedIcon #names

## useDefaultFallbacks

Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, ignores any past the first.

For example, if the icon name was "gnome-dev-cdrom-audio", the array would become

### C code

    {
      "gnome-dev-cdrom-audio",
      "gnome-dev-cdrom",
      "gnome-dev",
      "gnome",
      NULL
    };

constructThemedIconUseDefaultFallbacks :: (IsThemedIcon o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`use-default-fallbacks`” property. This is rarely needed directly, but it is used by `new`.

getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool Source #

Get the value of the “`use-default-fallbacks`” property. When overloading is enabled, this is equivalent to

    get themedIcon #useDefaultFallbacks