Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
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.
Synopsis
- newtype IconInfo = IconInfo (ManagedPtr IconInfo)
- class (GObject o, IsDescendantOf IconInfo o) => IsIconInfo o
- toIconInfo :: (MonadIO m, IsIconInfo o) => o -> m IconInfo
- noIconInfo :: Maybe IconInfo
- iconInfoGetAttachPoints :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Bool, [Point])
- iconInfoGetBaseScale :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Int32
- iconInfoGetBaseSize :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Int32
- iconInfoGetBuiltinPixbuf :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Maybe Pixbuf)
- iconInfoGetDisplayName :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Text
- iconInfoGetEmbeddedRect :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Bool, Rectangle)
- iconInfoGetFilename :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m (Maybe [Char])
- iconInfoIsSymbolic :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Bool
- iconInfoLoadIcon :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> m Pixbuf
- iconInfoLoadIconAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) => a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- iconInfoLoadIconFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m Pixbuf
- iconInfoLoadSurface :: (HasCallStack, MonadIO m, IsIconInfo a, IsWindow b) => a -> Maybe b -> m Surface
- iconInfoLoadSymbolic :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe RGBA -> m (Pixbuf, Bool)
- iconInfoLoadSymbolicAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsCancellable b) => a -> RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe RGBA -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- iconInfoLoadSymbolicFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m (Pixbuf, Bool)
- iconInfoLoadSymbolicForContext :: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b) => a -> b -> m (Pixbuf, Bool)
- iconInfoLoadSymbolicForContextAsync :: (HasCallStack, MonadIO m, IsIconInfo a, IsStyleContext b, IsCancellable c) => a -> b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- iconInfoLoadSymbolicForContextFinish :: (HasCallStack, MonadIO m, IsIconInfo a, IsAsyncResult b) => a -> b -> m (Pixbuf, Bool)
- 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
- iconInfoSetRawCoordinates :: (HasCallStack, MonadIO m, IsIconInfo a) => a -> Bool -> m ()
Exported types
Memory-managed wrapper type.
Instances
GObject IconInfo Source # | |
Defined in GI.Gtk.Objects.IconInfo gobjectType :: IO GType # | |
HasParentTypes IconInfo Source # | |
Defined in GI.Gtk.Objects.IconInfo | |
type ParentTypes IconInfo Source # | |
Defined in GI.Gtk.Objects.IconInfo |
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
(GObject o, IsDescendantOf IconInfo o) => IsIconInfo o Source # | |
Defined in GI.Gtk.Objects.IconInfo |
toIconInfo :: (MonadIO m, IsIconInfo o) => o -> m IconInfo Source #
Methods
getAttachPoints
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
:: (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
:: (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
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
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
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
:: (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
:: (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
:: (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
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
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
:: (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
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
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
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
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
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
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
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