gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.IconPaintable

Description

Contains information found when looking up an icon in GtkIconTheme.

GtkIconPaintable implements GdkPaintable.

Synopsis

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

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

TypedObject IconPaintable Source # 
Instance details

Defined in GI.Gtk.Objects.IconPaintable

Methods

glibType :: IO GType

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

gvalueSet_ :: Ptr GValue -> Maybe IconPaintable -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe IconPaintable)

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

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.

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: a GtkIconPaintable

-> m Bool

Returns: True if the icon is symbolic, False otherwise

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.

Note that to render a symbolic GtkIconPaintable properly (with recoloring), you have to set its icon name on a GtkImage.

newForFile

iconPaintableNewForFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) 
=> a

file: a GFile

-> Int32

size: desired icon size

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