Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- getAttachPoints
- getBaseScale
- getBaseSize
- getBuiltinPixbuf
- getDisplayName
- getEmbeddedRect
- getFilename
- isSymbolic
- loadIcon
- loadIconAsync
- loadIconFinish
- loadSurface
- loadSymbolic
- loadSymbolicAsync
- loadSymbolicFinish
- loadSymbolicForContext
- loadSymbolicForContextAsync
- loadSymbolicForContextFinish
- loadSymbolicForStyle
- newForPixbuf
- setRawCoordinates
Contains information found when looking up an icon in an icon theme.
- newtype IconInfo = IconInfo (ManagedPtr IconInfo)
- class GObject o => IsIconInfo o
- toIconInfo :: IsIconInfo o => o -> IO IconInfo
- noIconInfo :: Maybe IconInfo
- data IconInfoGetAttachPointsMethodInfo
- iconInfoGetAttachPoints :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Bool, [Point])
- data IconInfoGetBaseScaleMethodInfo
- iconInfoGetBaseScale :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Int32
- data IconInfoGetBaseSizeMethodInfo
- iconInfoGetBaseSize :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Int32
- data IconInfoGetBuiltinPixbufMethodInfo
- iconInfoGetBuiltinPixbuf :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Maybe Pixbuf)
- data IconInfoGetDisplayNameMethodInfo
- iconInfoGetDisplayName :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Text
- data IconInfoGetEmbeddedRectMethodInfo
- iconInfoGetEmbeddedRect :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Bool, Rectangle)
- data IconInfoGetFilenameMethodInfo
- iconInfoGetFilename :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Maybe [Char])
- data IconInfoIsSymbolicMethodInfo
- iconInfoIsSymbolic :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Bool
- data IconInfoLoadIconMethodInfo
- iconInfoLoadIcon :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Pixbuf
- data IconInfoLoadIconAsyncMethodInfo
- iconInfoLoadIconAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data IconInfoLoadIconFinishMethodInfo
- iconInfoLoadIconFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m Pixbuf
- data IconInfoLoadSurfaceMethodInfo
- iconInfoLoadSurface :: (HasCallStack, MonadIO m, IsIconInfo a, IsWindow b) => a -> Maybe b -> m Surface
- data IconInfoLoadSymbolicMethodInfo
- iconInfoLoadSymbolic :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe RGBA -> m (Pixbuf, Bool)
- data IconInfoLoadSymbolicAsyncMethodInfo
- iconInfoLoadSymbolicAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) => a -> RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- data IconInfoLoadSymbolicFinishMethodInfo
- iconInfoLoadSymbolicFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m (Pixbuf, Bool)
- data IconInfoLoadSymbolicForContextMethodInfo
- iconInfoLoadSymbolicForContext :: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b) => a -> b -> m (Pixbuf, Bool)
- data IconInfoLoadSymbolicForContextAsyncMethodInfo
- iconInfoLoadSymbolicForContextAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b, IsCancellable c) => a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- data IconInfoLoadSymbolicForContextFinishMethodInfo
- iconInfoLoadSymbolicForContextFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m (Pixbuf, Bool)
- data IconInfoLoadSymbolicForStyleMethodInfo
- iconInfoLoadSymbolicForStyle :: (HasCallStack, MonadIO m, IsIconInfo a, IsStyle b) => a -> b -> StateType -> m (Pixbuf, Bool)
- iconInfoNewForPixbuf :: (HasCallStack, MonadIO m, IsIconTheme a, IsPixbuf b) => a -> b -> m IconInfo
- data IconInfoSetRawCoordinatesMethodInfo
- iconInfoSetRawCoordinates :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> Bool -> m ()
Exported types
GObject IconInfo Source # | |
IsObject IconInfo Source # | |
IsIconInfo IconInfo Source # | |
((~) * info (ResolveIconInfoMethod t IconInfo), MethodInfo * info IconInfo p) => IsLabel t (IconInfo -> p) Source # | |
((~) * info (ResolveIconInfoMethod t IconInfo), MethodInfo * info IconInfo p) => IsLabelProxy t (IconInfo -> p) Source # | |
HasAttributeList * IconInfo Source # | |
type AttributeList IconInfo Source # | |
type SignalList IconInfo Source # | |
class GObject o => IsIconInfo o Source #
(GObject a, UnknownAncestorError Constraint IconInfo a) => IsIconInfo a Source # | |
IsIconInfo IconInfo Source # | |
toIconInfo :: IsIconInfo o => o -> IO IconInfo Source #
Methods
getAttachPoints
data IconInfoGetAttachPointsMethodInfo Source #
((~) * signature (m (Bool, [Point])), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetAttachPointsMethodInfo a signature Source # | |
iconInfoGetAttachPoints Source #
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m (Bool, [Point]) | Returns: |
Deprecated: (Since version 3.14)Attachment points are deprecated
This function is deprecated and always returns False
.
Since: 2.4
getBaseScale
data IconInfoGetBaseScaleMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetBaseScaleMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> 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
data IconInfoGetBaseSizeMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetBaseSizeMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> 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
data IconInfoGetBuiltinPixbufMethodInfo Source #
((~) * signature (m (Maybe Pixbuf)), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetBuiltinPixbufMethodInfo a signature Source # | |
iconInfoGetBuiltinPixbuf Source #
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m (Maybe Pixbuf) | Returns: the built-in image pixbuf, or |
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
data IconInfoGetDisplayNameMethodInfo Source #
((~) * signature (m Text), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetDisplayNameMethodInfo a signature Source # | |
iconInfoGetDisplayName Source #
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m Text | Returns: |
Deprecated: (Since version 3.14)Display names are deprecated
This function is deprecated and always returns Nothing
.
Since: 2.4
getEmbeddedRect
data IconInfoGetEmbeddedRectMethodInfo Source #
((~) * signature (m (Bool, Rectangle)), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetEmbeddedRectMethodInfo a signature Source # | |
iconInfoGetEmbeddedRect Source #
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m (Bool, Rectangle) | Returns: |
Deprecated: (Since version 3.14)Embedded rectangles are deprecated
This function is deprecated and always returns False
.
Since: 2.4
getFilename
data IconInfoGetFilenameMethodInfo Source #
((~) * signature (m (Maybe [Char])), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoGetFilenameMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m (Maybe [Char]) | Returns: the filename for the icon, or |
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
data IconInfoIsSymbolicMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoIsSymbolicMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> m Bool |
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
data IconInfoLoadIconMethodInfo Source #
((~) * signature (m Pixbuf), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoLoadIconMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> 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 |
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
data IconInfoLoadIconAsyncMethodInfo Source #
((~) * signature (Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsIconInfo a, IsCancellable b) => MethodInfo * IconInfoLoadIconAsyncMethodInfo a signature Source # | |
iconInfoLoadIconAsync Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) | |
=> a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> 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
data IconInfoLoadIconFinishMethodInfo Source #
((~) * signature (b -> m Pixbuf), MonadIO m, IsIconInfo a, IsAsyncResult b) => MethodInfo * IconInfoLoadIconFinishMethodInfo a signature Source # | |
iconInfoLoadIconFinish Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> 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 |
Finishes an async icon load, see iconInfoLoadIconAsync
.
Since: 3.8
loadSurface
data IconInfoLoadSurfaceMethodInfo Source #
((~) * signature (Maybe b -> m Surface), MonadIO m, IsIconInfo a, IsWindow b) => MethodInfo * IconInfoLoadSurfaceMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsIconInfo a, IsWindow b) | |
=> a |
|
-> Maybe b | |
-> 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 |
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
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> RGBA |
|
-> Maybe RGBA |
|
-> Maybe RGBA |
|
-> Maybe RGBA |
|
-> m (Pixbuf, Bool) | Returns: a |
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
data IconInfoLoadSymbolicAsyncMethodInfo Source #
((~) * signature (RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe b -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsIconInfo a, IsCancellable b) => MethodInfo * IconInfoLoadSymbolicAsyncMethodInfo a signature Source # | |
iconInfoLoadSymbolicAsync Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) | |
=> a |
|
-> RGBA |
|
-> Maybe RGBA |
|
-> Maybe RGBA |
|
-> Maybe RGBA |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> 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
data IconInfoLoadSymbolicFinishMethodInfo Source #
((~) * signature (b -> m (Pixbuf, Bool)), MonadIO m, IsIconInfo a, IsAsyncResult b) => MethodInfo * IconInfoLoadSymbolicFinishMethodInfo a signature Source # | |
iconInfoLoadSymbolicFinish Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> 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 |
Finishes an async icon load, see iconInfoLoadSymbolicAsync
.
Since: 3.8
loadSymbolicForContext
data IconInfoLoadSymbolicForContextMethodInfo Source #
((~) * signature (b -> m (Pixbuf, Bool)), MonadIO m, IsIconInfo a, IsStyleContext b) => MethodInfo * IconInfoLoadSymbolicForContextMethodInfo a signature Source # | |
iconInfoLoadSymbolicForContext Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b) | |
=> a |
|
-> b |
|
-> m (Pixbuf, Bool) | Returns: a |
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
data IconInfoLoadSymbolicForContextAsyncMethodInfo Source #
((~) * signature (b -> Maybe c -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsIconInfo a, IsStyleContext b, IsCancellable c) => MethodInfo * IconInfoLoadSymbolicForContextAsyncMethodInfo a signature Source # | |
iconInfoLoadSymbolicForContextAsync Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b, IsCancellable c) | |
=> a |
|
-> b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> 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
data IconInfoLoadSymbolicForContextFinishMethodInfo Source #
((~) * signature (b -> m (Pixbuf, Bool)), MonadIO m, IsIconInfo a, IsAsyncResult b) => MethodInfo * IconInfoLoadSymbolicForContextFinishMethodInfo a signature Source # | |
iconInfoLoadSymbolicForContextFinish Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> 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 |
Finishes an async icon load, see iconInfoLoadSymbolicForContextAsync
.
Since: 3.8
loadSymbolicForStyle
data IconInfoLoadSymbolicForStyleMethodInfo Source #
((~) * signature (b -> StateType -> m (Pixbuf, Bool)), MonadIO m, IsIconInfo a, IsStyle b) => MethodInfo * IconInfoLoadSymbolicForStyleMethodInfo a signature Source # | |
iconInfoLoadSymbolicForStyle Source #
:: (HasCallStack, MonadIO m, IsIconInfo a, IsStyle b) | |
=> a |
|
-> b |
|
-> StateType |
|
-> m (Pixbuf, Bool) | Returns: a |
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
:: (HasCallStack, MonadIO m, IsIconTheme a, IsPixbuf b) | |
=> a |
|
-> b |
|
-> m IconInfo | Returns: a |
setRawCoordinates
data IconInfoSetRawCoordinatesMethodInfo Source #
((~) * signature (Bool -> m ()), MonadIO m, IsIconInfo a) => MethodInfo * IconInfoSetRawCoordinatesMethodInfo a signature Source # | |
iconInfoSetRawCoordinates Source #
:: (HasCallStack, MonadIO m, IsIconInfo a) | |
=> a |
|
-> Bool |
|
-> 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