Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
ThemedIcon
is an implementation of Icon
that supports icon themes.
ThemedIcon
contains a list of all of the icons present in an icon
theme, so that icons can be looked up quickly. ThemedIcon
does
not provide actual pixmaps for icons, just the icon names.
Ideally something like gtk_icon_theme_choose_icon()
should be used to
resolve the list of names so that fallback icons work nicely with
themes that inherit other themes.
Synopsis
- newtype ThemedIcon = ThemedIcon (ManagedPtr ThemedIcon)
- class (GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o
- toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon
- noThemedIcon :: Maybe ThemedIcon
- themedIconAppendName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- themedIconGetNames :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> m [Text]
- themedIconNew :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconNewFromNames :: (HasCallStack, MonadIO m) => [Text] -> m ThemedIcon
- themedIconNewWithDefaultFallbacks :: (HasCallStack, MonadIO m) => Text -> m ThemedIcon
- themedIconPrependName :: (HasCallStack, MonadIO m, IsThemedIcon a) => a -> Text -> m ()
- constructThemedIconName :: IsThemedIcon o => Text -> IO (GValueConstruct o)
- constructThemedIconNames :: IsThemedIcon o => [Text] -> IO (GValueConstruct o)
- getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text]
- constructThemedIconUseDefaultFallbacks :: IsThemedIcon o => Bool -> IO (GValueConstruct o)
- getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool
Exported types
newtype ThemedIcon Source #
Memory-managed wrapper type.
Instances
Eq ThemedIcon Source # | |
Defined in GI.Gio.Objects.ThemedIcon (==) :: ThemedIcon -> ThemedIcon -> Bool # (/=) :: ThemedIcon -> ThemedIcon -> Bool # | |
GObject ThemedIcon Source # | |
Defined in GI.Gio.Objects.ThemedIcon gobjectType :: IO GType # | |
IsGValue ThemedIcon Source # | Convert |
Defined in GI.Gio.Objects.ThemedIcon toGValue :: ThemedIcon -> IO GValue # fromGValue :: GValue -> IO ThemedIcon # | |
HasParentTypes ThemedIcon Source # | |
Defined in GI.Gio.Objects.ThemedIcon | |
type ParentTypes ThemedIcon Source # | |
Defined in GI.Gio.Objects.ThemedIcon |
class (GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o Source #
Type class for types which can be safely cast to ThemedIcon
, for instance with toThemedIcon
.
Instances
(GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o Source # | |
Defined in GI.Gio.Objects.ThemedIcon |
toThemedIcon :: (MonadIO m, IsThemedIcon o) => o -> m ThemedIcon Source #
Cast to ThemedIcon
, for types for which this is known to be safe. For general casts, use castTo
.
noThemedIcon :: Maybe ThemedIcon Source #
A convenience alias for Nothing
:: Maybe
ThemedIcon
.
Methods
Overloaded methods
appendName
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> Text |
|
-> m () |
Append a name to the list of icons from within icon
.
Note that doing so invalidates the hash computed by prior calls
to iconHash
.
getNames
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> m [Text] | Returns: a list of icon names. |
Gets the names of icons from within icon
.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconname
.
newFromNames
themedIconNewFromNames Source #
:: (HasCallStack, MonadIO m) | |
=> [Text] |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconnames
.
newWithDefaultFallbacks
themedIconNewWithDefaultFallbacks Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m ThemedIcon | Returns: a new |
Creates a new themed icon for iconname
, and all the names
that can be created by shortening iconname
at '-' characters.
In the following example, icon1
and icon2
are equivalent:
C code
const char *names[] = { "gnome-dev-cdrom-audio", "gnome-dev-cdrom", "gnome-dev", "gnome" }; icon1 = g_themed_icon_new_from_names (names, 4); icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
prependName
themedIconPrependName Source #
:: (HasCallStack, MonadIO m, IsThemedIcon a) | |
=> a |
|
-> Text |
|
-> m () |
Prepend a name to the list of icons from within icon
.
Note that doing so invalidates the hash computed by prior calls
to iconHash
.
Since: 2.18
Properties
name
The icon name.
constructThemedIconName :: IsThemedIcon o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “name
” property. This is rarely needed directly, but it is used by new
.
names
A Nothing
-terminated array of icon names.
constructThemedIconNames :: IsThemedIcon o => [Text] -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “names
” property. This is rarely needed directly, but it is used by new
.
getThemedIconNames :: (MonadIO m, IsThemedIcon o) => o -> m [Text] Source #
Get the value of the “names
” property.
When overloading is enabled, this is equivalent to
get
themedIcon #names
useDefaultFallbacks
Whether to use the default fallbacks found by shortening the icon name at '-' characters. If the "names" array has more than one element, ignores any past the first.
For example, if the icon name was "gnome-dev-cdrom-audio", the array would become
C code
{ "gnome-dev-cdrom-audio", "gnome-dev-cdrom", "gnome-dev", "gnome", NULL };
constructThemedIconUseDefaultFallbacks :: IsThemedIcon o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “use-default-fallbacks
” property. This is rarely needed directly, but it is used by new
.
getThemedIconUseDefaultFallbacks :: (MonadIO m, IsThemedIcon o) => o -> m Bool Source #
Get the value of the “use-default-fallbacks
” property.
When overloading is enabled, this is equivalent to
get
themedIcon #useDefaultFallbacks