gi-gtk3-3.0.44: Gtk 3.x 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.Gtk.Structs.IconSource

Contents

- Exported types
- Methods
  - copy
  - free
  - getDirection
  - getDirectionWildcarded
  - getFilename
  - getIconName
  - getPixbuf
  - getSize
  - getSizeWildcarded
  - getState
  - getStateWildcarded
  - new
  - setDirection
  - setDirectionWildcarded
  - setFilename
  - setIconName
  - setPixbuf
  - setSize
  - setSizeWildcarded
  - setState
  - setStateWildcarded

Description

No description available in the introspection data.

Synopsis

- newtype IconSource = IconSource (ManagedPtr IconSource)
- iconSourceCopy :: (HasCallStack, MonadIO m) => IconSource -> m IconSource
- iconSourceFree :: (HasCallStack, MonadIO m) => IconSource -> m ()
- iconSourceGetDirection :: (HasCallStack, MonadIO m) => IconSource -> m TextDirection
- iconSourceGetDirectionWildcarded :: (HasCallStack, MonadIO m) => IconSource -> m Bool
- iconSourceGetFilename :: (HasCallStack, MonadIO m) => IconSource -> m [Char]
- iconSourceGetIconName :: (HasCallStack, MonadIO m) => IconSource -> m Text
- iconSourceGetPixbuf :: (HasCallStack, MonadIO m) => IconSource -> m Pixbuf
- iconSourceGetSize :: (HasCallStack, MonadIO m) => IconSource -> m Int32
- iconSourceGetSizeWildcarded :: (HasCallStack, MonadIO m) => IconSource -> m Bool
- iconSourceGetState :: (HasCallStack, MonadIO m) => IconSource -> m StateType
- iconSourceGetStateWildcarded :: (HasCallStack, MonadIO m) => IconSource -> m Bool
- iconSourceNew :: (HasCallStack, MonadIO m) => m IconSource
- iconSourceSetDirection :: (HasCallStack, MonadIO m) => IconSource -> TextDirection -> m ()
- iconSourceSetDirectionWildcarded :: (HasCallStack, MonadIO m) => IconSource -> Bool -> m ()
- iconSourceSetFilename :: (HasCallStack, MonadIO m) => IconSource -> [Char] -> m ()
- iconSourceSetIconName :: (HasCallStack, MonadIO m) => IconSource -> Maybe Text -> m ()
- iconSourceSetPixbuf :: (HasCallStack, MonadIO m, IsPixbuf a) => IconSource -> a -> m ()
- iconSourceSetSize :: (HasCallStack, MonadIO m) => IconSource -> Int32 -> m ()
- iconSourceSetSizeWildcarded :: (HasCallStack, MonadIO m) => IconSource -> Bool -> m ()
- iconSourceSetState :: (HasCallStack, MonadIO m) => IconSource -> StateType -> m ()
- iconSourceSetStateWildcarded :: (HasCallStack, MonadIO m) => IconSource -> Bool -> m ()

# Exported types

newtype IconSource Source #

Memory-managed wrapper type.

Constructors

IconSource (ManagedPtr IconSource) |

#### Instances

Instances details

Eq IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource Methods (==) :: IconSource -> IconSource -> Bool Source # (/=) :: IconSource -> IconSource -> Bool Source #
GBoxed IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource
ManagedPtrNewtype IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource Methods toManagedPtr :: IconSource -> ManagedPtr IconSource Source #
TypedObject IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource Methods glibType :: IO GType Source #
HasParentTypes IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource
IsGValue (Maybe IconSource) Source # | Convert `IconSource` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.IconSource Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe IconSource -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe IconSource) Source #
type ParentTypes IconSource Source # |
Instance details Defined in GI.Gtk.Structs.IconSource type ParentTypes IconSource = '[] :: [Type]

# Methods

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

Expand

#### Methods

copy, free.

#### Getters

getDirection, getDirectionWildcarded, getFilename, getIconName, getPixbuf, getSize, getSizeWildcarded, getState, getStateWildcarded.

#### Setters

setDirection, setDirectionWildcarded, setFilename, setIconName, setPixbuf, setSize, setSizeWildcarded, setState, setStateWildcarded.

## copy

iconSourceCopy Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m IconSource | Returns: a new `IconSource`

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Creates a copy of `source`; mostly useful for language bindings.

## free

iconSourceFree Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Frees a dynamically-allocated icon source, along with its filename, size, and pixbuf fields if those are not `Nothing`.

## getDirection

iconSourceGetDirection Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m TextDirection | Returns: text direction this source matches

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Obtains the text direction this icon source applies to. The return value is only useful/meaningful if the text direction is not wildcarded.

## getDirectionWildcarded

iconSourceGetDirectionWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Bool | Returns: `True` if this icon source is a base for any text direction variant

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Gets the value set by `iconSourceSetDirectionWildcarded`.

## getFilename

iconSourceGetFilename Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m [Char] | Returns: image filename. This string must not be modified or freed.

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Retrieves the source filename, or `Nothing` if none is set. The filename is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

## getIconName

iconSourceGetIconName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Text | Returns: icon name. This string must not be modified or freed.

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Retrieves the source icon name, or `Nothing` if none is set. The icon_name is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

## getPixbuf

iconSourceGetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Pixbuf | Returns: source pixbuf

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Retrieves the source pixbuf, or `Nothing` if none is set. In addition, if a filename source is in use, this function in some cases will return the pixbuf from loaded from the filename. This is, for example, true for the GtkIconSource passed to the `Style` `render_icon()` virtual function. The reference count on the pixbuf is not incremented.

## getSize

iconSourceGetSize Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Int32 | Returns: icon size (t`IconSize`) this source matches.

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Obtains the icon size this source applies to. The return value is only useful/meaningful if the icon size is not wildcarded.

## getSizeWildcarded

iconSourceGetSizeWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Bool | Returns: `True` if this icon source is a base for any icon size variant

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Gets the value set by `iconSourceSetSizeWildcarded`.

## getState

iconSourceGetState Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m StateType | Returns: widget state this source matches

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Obtains the widget state this icon source applies to. The return value is only useful/meaningful if the widget state is not wildcarded.

## getStateWildcarded

iconSourceGetStateWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> m Bool | Returns: `True` if this icon source is a base for any widget state variant

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Gets the value set by `iconSourceSetStateWildcarded`.

## new

iconSourceNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m IconSource | Returns: a new `IconSource`

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Creates a new `IconSource`. A `IconSource` contains a `Pixbuf` (or image filename) that serves as the base image for one or more of the icons in a `IconSet`, along with a specification for which icons in the icon set will be based on that pixbuf or image file. An icon set contains a set of icons that represent “the same” logical concept in different states, different global text directions, and different sizes.

So for example a web browser’s “Back to Previous Page” icon might point in a different direction in Hebrew and in English; it might look different when insensitive; and it might change size depending on toolbar mode (small/large icons). So a single icon set would contain all those variants of the icon. `IconSet` contains a list of `IconSource` from which it can derive specific icon variants in the set.

In the simplest case, `IconSet` contains one source pixbuf from which it derives all variants. The convenience function `iconSetNewFromPixbuf` handles this case; if you only have one source pixbuf, just use that function.

If you want to use a different base pixbuf for different icon variants, you create multiple icon sources, mark which variants they’ll be used to create, and add them to the icon set with `iconSetAddSource`.

By default, the icon source has all parameters wildcarded. That is, the icon source will be used as the base icon for any desired text direction, widget state, or icon size.

## setDirection

iconSourceSetDirection Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> TextDirection | `direction`: text direction this source applies to
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets the text direction this icon source is intended to be used with.

Setting the text direction on an icon source makes no difference if the text direction is wildcarded. Therefore, you should usually call `iconSourceSetDirectionWildcarded` to un-wildcard it in addition to calling this function.

## setDirectionWildcarded

iconSourceSetDirectionWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> Bool | `setting`: `True` to wildcard the text direction
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

If the text direction is wildcarded, this source can be used as the base image for an icon in any `TextDirection`. If the text direction is not wildcarded, then the text direction the icon source applies to should be set with `iconSourceSetDirection`, and the icon source will only be used with that text direction.

`IconSet` prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

## setFilename

iconSourceSetFilename Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> [Char] | `filename`: image file to use
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets the name of an image file to use as a base image when creating icon variants for `IconSet`. The filename must be absolute.

## setIconName

iconSourceSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> Maybe Text | `iconName`: name of icon to use
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets the name of an icon to look up in the current icon theme to use as a base image when creating icon variants for `IconSet`.

## setPixbuf

iconSourceSetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a) |
=> IconSource | `source`: a `IconSource`
-> a | `pixbuf`: pixbuf to use as a source
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets a pixbuf to use as a base image when creating icon variants for `IconSet`.

## setSize

iconSourceSetSize Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> Int32 | `size`: icon size (t`IconSize`) this source applies to
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets the icon size this icon source is intended to be used with.

Setting the icon size on an icon source makes no difference if the size is wildcarded. Therefore, you should usually call `iconSourceSetSizeWildcarded` to un-wildcard it in addition to calling this function.

## setSizeWildcarded

iconSourceSetSizeWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> Bool | `setting`: `True` to wildcard the widget state
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

If the icon size is wildcarded, this source can be used as the base image for an icon of any size. If the size is not wildcarded, then the size the source applies to should be set with `iconSourceSetSize` and the icon source will only be used with that specific size.

`IconSet` prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

`IconSet` will normally scale wildcarded source images to produce an appropriate icon at a given size, but will not change the size of source images that match exactly.

## setState

iconSourceSetState Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> StateType | `state`: widget state this source applies to
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

Sets the widget state this icon source is intended to be used with.

Setting the widget state on an icon source makes no difference if the state is wildcarded. Therefore, you should usually call `iconSourceSetStateWildcarded` to un-wildcard it in addition to calling this function.

## setStateWildcarded

iconSourceSetStateWildcarded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> IconSource | `source`: a `IconSource`
-> Bool | `setting`: `True` to wildcard the widget state
-> m () |

Deprecated: (Since version 3.10)Use `IconTheme` instead.

If the widget state is wildcarded, this source can be used as the base image for an icon in any `StateType`. If the widget state is not wildcarded, then the state the source applies to should be set with `iconSourceSetState` and the icon source will only be used with that specific state.

`IconSet` prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

`IconSet` will normally transform wildcarded source images to produce an appropriate icon for a given state, for example lightening an image on prelight, but will not modify source images that match exactly.