gi-gtk4-4.0.12: Gtk 4.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.Objects.IconPaintable

Contents

- Exported types
- Methods
  - getFile
  - getIconName
  - isSymbolic
  - newForFile
- Properties
  - file
  - iconName
  - isSymbolic
  - scale
  - size

Description

Contains information found when looking up an icon in `GtkIconTheme` or loading it from a file.

`GtkIconPaintable` implements `GdkPaintable` and `GtkSymbolicPaintable`.

Synopsis

- newtype IconPaintable = IconPaintable (ManagedPtr IconPaintable)
- class (GObject o, IsDescendantOf IconPaintable o) => IsIconPaintable o
- toIconPaintable :: (MonadIO m, IsIconPaintable o) => o -> m IconPaintable
- iconPaintableGetFile :: (HasCallStack, MonadIO m, IsIconPaintable a) => a -> m (Maybe File)
- iconPaintableGetIconName :: (HasCallStack, MonadIO m, IsIconPaintable a) => a -> m (Maybe [Char])
- iconPaintableIsSymbolic :: (HasCallStack, MonadIO m, IsIconPaintable a) => a -> m Bool
- iconPaintableNewForFile :: (HasCallStack, MonadIO m, IsFile a) => a -> Int32 -> Int32 -> m IconPaintable
- constructIconPaintableFile :: (IsIconPaintable o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getIconPaintableFile :: (MonadIO m, IsIconPaintable o) => o -> m (Maybe File)
- constructIconPaintableIconName :: (IsIconPaintable o, MonadIO m) => Text -> m (GValueConstruct o)
- getIconPaintableIconName :: (MonadIO m, IsIconPaintable o) => o -> m (Maybe Text)
- constructIconPaintableIsSymbolic :: (IsIconPaintable o, MonadIO m) => Bool -> m (GValueConstruct o)
- getIconPaintableIsSymbolic :: (MonadIO m, IsIconPaintable o) => o -> m Bool
- setIconPaintableIsSymbolic :: (MonadIO m, IsIconPaintable o) => o -> Bool -> m ()
- constructIconPaintableScale :: (IsIconPaintable o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getIconPaintableScale :: (MonadIO m, IsIconPaintable o) => o -> m Int32
- setIconPaintableScale :: (MonadIO m, IsIconPaintable o) => o -> Int32 -> m ()
- constructIconPaintableSize :: (IsIconPaintable o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getIconPaintableSize :: (MonadIO m, IsIconPaintable o) => o -> m Int32
- setIconPaintableSize :: (MonadIO m, IsIconPaintable o) => o -> Int32 -> m ()

# Exported types

newtype IconPaintable Source #

Memory-managed wrapper type.

Constructors

IconPaintable (ManagedPtr IconPaintable) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf IconPaintable o) => IsIconPaintable o Source #

Type class for types which can be safely cast to `IconPaintable`, for instance with `toIconPaintable`.

#### Instances

Instances details

(GObject o, IsDescendantOf IconPaintable o) => IsIconPaintable o Source # |
Instance details Defined in GI.Gtk.Objects.IconPaintable

toIconPaintable :: (MonadIO m, IsIconPaintable o) => o -> m IconPaintable Source #

Cast to `IconPaintable`, 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

bindProperty, bindPropertyFull, computeConcreteSize, forceFloating, freezeNotify, getv, invalidateContents, invalidateSize, isFloating, isSymbolic, notify, notifyByPspec, ref, refSink, runDispose, snapshot, snapshotSymbolic, snapshotWithWeight, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getCurrentImage, getData, getFile, getFlags, getIconName, getIntrinsicAspectRatio, getIntrinsicHeight, getIntrinsicWidth, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## getFile

iconPaintableGetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconPaintable a) |
=> a | `self`: a `GtkIconPaintable`
-> m (Maybe File) | Returns: the `GFile` for the icon

Gets the `GFile` that was used to load the icon.

Returns `Nothing` if the icon was not loaded from a file.

## getIconName

iconPaintableGetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconPaintable a) |
=> a | `self`: a `GtkIconPaintable`
-> m (Maybe [Char]) | Returns: the themed icon-name for the icon, or `Nothing` if its not a themed icon.

Deprecated: (Since version 4.20)

Get the icon name being used for this icon.

When an icon looked up in the icon theme was not available, the icon theme may use fallback icons - either those specified to `iconThemeLookupIcon` or the always-available "image-missing". The icon chosen is returned by this function.

If the icon was created without an icon theme, this function returns `Nothing`.

## isSymbolic

iconPaintableIsSymbolic Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconPaintable a) |
=> a | `self`: an icon paintable
-> m Bool | Returns: true if the icon is symbolic, false otherwise

Deprecated: (Since version 4.20)

Checks if the icon is symbolic or not.

This currently uses only the file name and not the file contents for determining this. This behaviour may change in the future.

## newForFile

iconPaintableNewForFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) |
=> a | `file`: a `GFile`
-> Int32 | `size`: desired icon size, in application pixels
-> Int32 | `scale`: the desired scale
-> m IconPaintable | Returns: a `GtkIconPaintable` containing for the icon. Unref with `objectUnref`

Creates a `GtkIconPaintable` for a file with a given size and scale.

The icon can then be rendered by using it as a `GdkPaintable`.

# Properties

## file

The file representing the icon, if any.

constructIconPaintableFile :: (IsIconPaintable o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

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

getIconPaintableFile :: (MonadIO m, IsIconPaintable o) => o -> m (Maybe File) Source #

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

    get iconPaintable #file

## iconName

The icon name that was chosen during lookup.

constructIconPaintableIconName :: (IsIconPaintable o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getIconPaintableIconName :: (MonadIO m, IsIconPaintable o) => o -> m (Maybe Text) Source #

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

    get iconPaintable #iconName

## isSymbolic

Whether the icon is symbolic or not.

constructIconPaintableIsSymbolic :: (IsIconPaintable o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getIconPaintableIsSymbolic :: (MonadIO m, IsIconPaintable o) => o -> m Bool Source #

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

    get iconPaintable #isSymbolic

setIconPaintableIsSymbolic :: (MonadIO m, IsIconPaintable o) => o -> Bool -> m () Source #

Set the value of the “`is-symbolic`” property. When overloading is enabled, this is equivalent to

    set iconPaintable [ #isSymbolic := value ]

## scale

No description available in the introspection data.

constructIconPaintableScale :: (IsIconPaintable o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getIconPaintableScale :: (MonadIO m, IsIconPaintable o) => o -> m Int32 Source #

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

    get iconPaintable #scale

setIconPaintableScale :: (MonadIO m, IsIconPaintable o) => o -> Int32 -> m () Source #

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

    set iconPaintable [ #scale := value ]

## size

No description available in the introspection data.

constructIconPaintableSize :: (IsIconPaintable o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getIconPaintableSize :: (MonadIO m, IsIconPaintable o) => o -> m Int32 Source #

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

    get iconPaintable #size

setIconPaintableSize :: (MonadIO m, IsIconPaintable o) => o -> Int32 -> m () Source #

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

    set iconPaintable [ #size := value ]