gi-gtk-3.0.42: 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.IconInfo

Description

Contains information found when looking up an icon in an icon theme.

Synopsis

Exported types

newtype IconInfo Source #

Memory-managed wrapper type.

Constructors

IconInfo (ManagedPtr IconInfo) 

Instances

Instances details
Eq IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

GObject IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

ManagedPtrNewtype IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

Methods

toManagedPtr :: IconInfo -> ManagedPtr IconInfo

TypedObject IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

Methods

glibType :: IO GType

HasParentTypes IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

IsGValue (Maybe IconInfo) Source #

Convert IconInfo to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.IconInfo

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes IconInfo Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

type ParentTypes IconInfo = '[Object]

class (GObject o, IsDescendantOf IconInfo o) => IsIconInfo o Source #

Type class for types which can be safely cast to IconInfo, for instance with toIconInfo.

Instances

Instances details
(GObject o, IsDescendantOf IconInfo o) => IsIconInfo o Source # 
Instance details

Defined in GI.Gtk.Objects.IconInfo

toIconInfo :: (MonadIO m, IsIconInfo o) => o -> m IconInfo Source #

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

Methods

getAttachPoints

iconInfoGetAttachPoints Source #

Arguments

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

iconInfo: a IconInfo

-> m (Bool, [Point])

Returns: False

Deprecated: (Since version 3.14)Attachment points are deprecated

This function is deprecated and always returns False.

Since: 2.4

getBaseScale

iconInfoGetBaseScale Source #

Arguments

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

iconInfo: a IconInfo

-> m Int32

Returns: the base scale

Gets the base scale for the icon. The base scale is a scale for the icon that was specified by the icon theme creator. For instance an icon drawn for a high-dpi screen with window scale 2 for a base size of 32 will be 64 pixels tall and have a base scale of 2.

Since: 3.10

getBaseSize

iconInfoGetBaseSize Source #

Arguments

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

iconInfo: a IconInfo

-> m Int32

Returns: the base size, or 0, if no base size is known for the icon.

Gets the base size for the icon. The base size is a size for the icon that was specified by the icon theme creator. This may be different than the actual size of image; an example of this is small emblem icons that can be attached to a larger icon. These icons will be given the same base size as the larger icons to which they are attached.

Note that for scaled icons the base size does not include the base scale.

Since: 2.4

getBuiltinPixbuf

iconInfoGetBuiltinPixbuf Source #

Arguments

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

iconInfo: a IconInfo

-> m (Maybe Pixbuf)

Returns: the built-in image pixbuf, or Nothing. No extra reference is added to the returned pixbuf, so if you want to keep it around, you must use objectRef. The returned image must not be modified.

Deprecated: (Since version 3.14)This function is deprecated, use iconThemeAddResourcePath instead of builtin icons.

Gets the built-in image for this icon, if any. To allow GTK+ to use built in icon images, you must pass the IconLookupFlagsUseBuiltin to iconThemeLookupIcon.

Since: 2.4

getDisplayName

iconInfoGetDisplayName Source #

Arguments

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

iconInfo: a IconInfo

-> m Text

Returns: Nothing

Deprecated: (Since version 3.14)Display names are deprecated

This function is deprecated and always returns Nothing.

Since: 2.4

getEmbeddedRect

iconInfoGetEmbeddedRect Source #

Arguments

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

iconInfo: a IconInfo

-> m (Bool, Rectangle)

Returns: False

Deprecated: (Since version 3.14)Embedded rectangles are deprecated

This function is deprecated and always returns False.

Since: 2.4

getFilename

iconInfoGetFilename Source #

Arguments

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

iconInfo: a IconInfo

-> m (Maybe [Char])

Returns: the filename for the icon, or Nothing if iconInfoGetBuiltinPixbuf should be used instead. The return value is owned by GTK+ and should not be modified or freed.

Gets the filename for the icon. If the IconLookupFlagsUseBuiltin flag was passed to iconThemeLookupIcon, there may be no filename if a builtin icon is returned; in this case, you should use iconInfoGetBuiltinPixbuf.

Since: 2.4

isSymbolic

iconInfoIsSymbolic Source #

Arguments

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

iconInfo: a IconInfo

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

Since: 3.12

loadIcon

iconInfoLoadIcon Source #

Arguments

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

iconInfo: a IconInfo from iconThemeLookupIcon

-> m Pixbuf

Returns: the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use objectUnref to release your reference to the icon. (Can throw GError)

Renders an icon previously looked up in an icon theme using iconThemeLookupIcon; the size will be based on the size passed to iconThemeLookupIcon. Note that the resulting pixbuf may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.). This behaviour can be changed by passing the IconLookupFlagsForceSize flag when obtaining the IconInfo. If this flag has been specified, the pixbuf returned by this function will be scaled to the exact size.

Since: 2.4

loadIconAsync

iconInfoLoadIconAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> Maybe b

cancellable: optional Cancellable object, Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously load, render and scale an icon previously looked up from the icon theme using iconThemeLookupIcon.

For more details, see iconInfoLoadIcon which is the synchronous version of this call.

Since: 3.8

loadIconFinish

iconInfoLoadIconFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> b

res: a AsyncResult

-> m Pixbuf

Returns: the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use objectUnref to release your reference to the icon. (Can throw GError)

Finishes an async icon load, see iconInfoLoadIconAsync.

Since: 3.8

loadSurface

iconInfoLoadSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsWindow b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> Maybe b

forWindow: Window to optimize drawing for, or Nothing

-> m Surface

Returns: the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use cairo_surface_destroy() to release your reference to the icon. (Can throw GError)

Renders an icon previously looked up in an icon theme using iconThemeLookupIcon; the size will be based on the size passed to iconThemeLookupIcon. Note that the resulting surface may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size or for which the source image would have to be scaled up too far. (This maintains sharpness.). This behaviour can be changed by passing the IconLookupFlagsForceSize flag when obtaining the IconInfo. If this flag has been specified, the pixbuf returned by this function will be scaled to the exact size.

Since: 3.10

loadSymbolic

iconInfoLoadSymbolic Source #

Arguments

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

iconInfo: a IconInfo

-> RGBA

fg: a RGBA representing the foreground color of the icon

-> Maybe RGBA

successColor: a RGBA representing the warning color of the icon or Nothing to use the default color

-> Maybe RGBA

warningColor: a RGBA representing the warning color of the icon or Nothing to use the default color

-> Maybe RGBA

errorColor: a RGBA representing the error color of the icon or Nothing to use the default color (allow-none)

-> m (Pixbuf, Bool)

Returns: a Pixbuf representing the loaded icon (Can throw GError)

Loads an icon, modifying it to match the system colours for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from iconInfoLoadIcon.

This allows loading symbolic icons that will match the system theme.

Unless you are implementing a widget, you will want to use themedIconNewWithDefaultFallbacks to load the icon.

As implementation details, the icon loaded needs to be of SVG type, contain the “symbolic” term as the last component of the icon name, and use the “fg”, “success”, “warning” and “error” CSS styles in the SVG file itself.

See the Symbolic Icons Specification for more information about symbolic icons.

Since: 3.0

loadSymbolicAsync

iconInfoLoadSymbolicAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> RGBA

fg: a RGBA representing the foreground color of the icon

-> Maybe RGBA

successColor: a RGBA representing the warning color of the icon or Nothing to use the default color

-> Maybe RGBA

warningColor: a RGBA representing the warning color of the icon or Nothing to use the default color

-> Maybe RGBA

errorColor: a RGBA representing the error color of the icon or Nothing to use the default color (allow-none)

-> Maybe b

cancellable: optional Cancellable object, Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using iconThemeLookupIcon.

For more details, see iconInfoLoadSymbolic which is the synchronous version of this call.

Since: 3.8

loadSymbolicFinish

iconInfoLoadSymbolicFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> b

res: a AsyncResult

-> m (Pixbuf, Bool)

Returns: the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use objectUnref to release your reference to the icon. (Can throw GError)

Finishes an async icon load, see iconInfoLoadSymbolicAsync.

Since: 3.8

loadSymbolicForContext

iconInfoLoadSymbolicForContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b) 
=> a

iconInfo: a IconInfo

-> b

context: a StyleContext

-> m (Pixbuf, Bool)

Returns: a Pixbuf representing the loaded icon (Can throw GError)

Loads an icon, modifying it to match the system colors for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from iconInfoLoadIcon. This function uses the regular foreground color and the symbolic colors with the names “success_color”, “warning_color” and “error_color” from the context.

This allows loading symbolic icons that will match the system theme.

See iconInfoLoadSymbolic for more details.

Since: 3.0

loadSymbolicForContextAsync

iconInfoLoadSymbolicForContextAsync Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b, IsCancellable c) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> b

context: a StyleContext

-> Maybe c

cancellable: optional Cancellable object, Nothing to ignore

-> Maybe AsyncReadyCallback

callback: a AsyncReadyCallback to call when the request is satisfied

-> m () 

Asynchronously load, render and scale a symbolic icon previously looked up from the icon theme using iconThemeLookupIcon.

For more details, see iconInfoLoadSymbolicForContext which is the synchronous version of this call.

Since: 3.8

loadSymbolicForContextFinish

iconInfoLoadSymbolicForContextFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) 
=> a

iconInfo: a IconInfo from iconThemeLookupIcon

-> b

res: a AsyncResult

-> m (Pixbuf, Bool)

Returns: the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use objectUnref to release your reference to the icon. (Can throw GError)

Finishes an async icon load, see iconInfoLoadSymbolicForContextAsync.

Since: 3.8

loadSymbolicForStyle

iconInfoLoadSymbolicForStyle Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyle b) 
=> a

iconInfo: a IconInfo

-> b

style: a Style to take the colors from

-> StateType

state: the widget state to use for colors

-> m (Pixbuf, Bool)

Returns: a Pixbuf representing the loaded icon (Can throw GError)

Deprecated: (Since version 3.0)Use iconInfoLoadSymbolicForContext instead

Loads an icon, modifying it to match the system colours for the foreground, success, warning and error colors provided. If the icon is not a symbolic one, the function will return the result from iconInfoLoadIcon.

This allows loading symbolic icons that will match the system theme.

See iconInfoLoadSymbolic for more details.

Since: 3.0

newForPixbuf

iconInfoNewForPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsIconTheme a, IsPixbuf b) 
=> a

iconTheme: a IconTheme

-> b

pixbuf: the pixbuf to wrap in a IconInfo

-> m IconInfo

Returns: a IconInfo

Creates a IconInfo for a Pixbuf.

Since: 2.14

setRawCoordinates

iconInfoSetRawCoordinates Source #

Arguments

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

iconInfo: a IconInfo

-> Bool

rawCoordinates: whether the coordinates of embedded rectangles and attached points should be returned in their original (unscaled) form.

-> m () 

Deprecated: (Since version 3.14)Embedded rectangles and attachment points are deprecated

Sets whether the coordinates returned by iconInfoGetEmbeddedRect and iconInfoGetAttachPoints should be returned in their original form as specified in the icon theme, instead of scaled appropriately for the pixbuf returned by iconInfoLoadIcon.

Raw coordinates are somewhat strange; they are specified to be with respect to the unscaled pixmap for PNG and XPM icons, but for SVG icons, they are in a 1000x1000 coordinate space that is scaled to the final size of the icon. You can determine if the icon is an SVG icon by using iconInfoGetFilename, and seeing if it is non-Nothing and ends in “.svg”.

This function is provided primarily to allow compatibility wrappers for older API's, and is not expected to be useful for applications.

Since: 2.4