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.Interfaces.SymbolicPaintable

Contents

- Exported types
- Methods
  - snapshotSymbolic
  - snapshotWithWeight

Description

An interface that supports symbolic colors in paintables.

`GdkPaintable`s implementing the interface will have the `SymbolicPaintable`.`snapshot_symbolic`() function called and have the colors for drawing symbolic icons passed. At least 5 colors are guaranteed to be passed every time. These 5 colors are the foreground color, and the colors to use for errors, warnings and success information in that order, followed by the system accent color.

The system accent color has been added in GTK 4.22. More colors may be added in the future.

Since: 4.6

Synopsis

- newtype SymbolicPaintable = SymbolicPaintable (ManagedPtr SymbolicPaintable)
- class (GObject o, IsDescendantOf SymbolicPaintable o) => IsSymbolicPaintable o
- toSymbolicPaintable :: (MonadIO m, IsSymbolicPaintable o) => o -> m SymbolicPaintable
- symbolicPaintableSnapshotSymbolic :: (HasCallStack, MonadIO m, IsSymbolicPaintable a, IsSnapshot b) => a -> b -> Double -> Double -> [RGBA] -> m ()
- symbolicPaintableSnapshotWithWeight :: (HasCallStack, MonadIO m, IsSymbolicPaintable a, IsSnapshot b) => a -> b -> Double -> Double -> [RGBA] -> Double -> m ()

# Exported types

newtype SymbolicPaintable Source #

Memory-managed wrapper type.

Constructors

SymbolicPaintable (ManagedPtr SymbolicPaintable) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf SymbolicPaintable o) => IsSymbolicPaintable o Source #

Type class for types which can be safely cast to `SymbolicPaintable`, for instance with `toSymbolicPaintable`.

#### Instances

Instances details

(GObject o, IsDescendantOf SymbolicPaintable o) => IsSymbolicPaintable o Source # |
Instance details Defined in GI.Gtk.Interfaces.SymbolicPaintable

toSymbolicPaintable :: (MonadIO m, IsSymbolicPaintable o) => o -> m SymbolicPaintable Source #

Cast to `SymbolicPaintable`, 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, notify, notifyByPspec, ref, refSink, runDispose, snapshot, snapshotSymbolic, snapshotWithWeight, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

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

#### Setters

setData, setDataFull, setProperty.

## snapshotSymbolic

symbolicPaintableSnapshotSymbolic Source #

Arguments

:: (HasCallStack, MonadIO m, IsSymbolicPaintable a, IsSnapshot b) |
=> a | `paintable`: a `GtkSymbolicPaintable`
-> b | `snapshot`: a `GdkSnapshot` to snapshot to
-> Double | `width`: width to snapshot in
-> Double | `height`: height to snapshot in
-> [RGBA] | `colors`: a pointer to an array of colors
-> m () |

Snapshots the paintable with the given colors.

If less than 5 colors are provided, GTK will pad the array with default colors.

Since: 4.6

## snapshotWithWeight

symbolicPaintableSnapshotWithWeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsSymbolicPaintable a, IsSnapshot b) |
=> a | `paintable`: a `GtkSymbolicPaintable`
-> b | `snapshot`: a `GdkSnapshot` to snapshot to
-> Double | `width`: width to snapshot in
-> Double | `height`: height to snapshot in
-> [RGBA] | `colors`: a pointer to an array of colors
-> Double | `weight`: The font weight to use (from 1 to 1000, with default 400)
-> m () |

Snapshots the paintable with the given colors and weight.

If less than 5 colors are provided, GTK will pad the array with default colors.

Since: 4.22