gi-gio-2.0.30: Gio bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gio.Objects.ThemedIcon

Description

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

Exported types

newtype ThemedIcon Source #

Memory-managed wrapper type.

Constructors

ThemedIcon (ManagedPtr ThemedIcon) 

Instances

Instances details
Eq ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

GObject ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

ManagedPtrNewtype ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

Methods

toManagedPtr :: ThemedIcon -> ManagedPtr ThemedIcon

TypedObject ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

Methods

glibType :: IO GType

HasParentTypes ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

IsGValue (Maybe ThemedIcon) Source #

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

Instance details

Defined in GI.Gio.Objects.ThemedIcon

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes ThemedIcon Source # 
Instance details

Defined in GI.Gio.Objects.ThemedIcon

type ParentTypes ThemedIcon = '[Object, Icon]

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

Instances details
(GObject o, IsDescendantOf ThemedIcon o) => IsThemedIcon o Source # 
Instance details

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.

Methods

appendName

themedIconAppendName Source #

Arguments

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

icon: a ThemedIcon

-> Text

iconname: name of icon to append to list of icons from within icon.

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

themedIconGetNames Source #

Arguments

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

icon: a ThemedIcon.

-> m [Text]

Returns: a list of icon names.

Gets the names of icons from within icon.

new

themedIconNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

iconname: a string containing an icon name.

-> m ThemedIcon

Returns: a new ThemedIcon.

Creates a new themed icon for iconname.

newFromNames

themedIconNewFromNames Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Text]

iconnames: an array of strings containing icon names.

-> m ThemedIcon

Returns: a new ThemedIcon

Creates a new themed icon for iconnames.

newWithDefaultFallbacks

themedIconNewWithDefaultFallbacks Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

iconname: a string containing an icon name

-> m ThemedIcon

Returns: a new ThemedIcon.

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 #

Arguments

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

icon: a ThemedIcon

-> Text

iconname: name of icon to prepend to list of icons from within icon.

-> 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, MonadIO m) => Text -> m (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, MonadIO m) => [Text] -> m (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, MonadIO m) => Bool -> m (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