| |||||||||||||||
| |||||||||||||||
| |||||||||||||||
Description | |||||||||||||||
Manipulating stock icons | |||||||||||||||
Synopsis | |||||||||||||||
Detail | |||||||||||||||
Browse the available stock icons in the list of stock IDs found here. You can also use the gtk-demo application for this purpose. An icon factory manages a collection of IconSet; a IconSet manages a set of variants of a particular icon (i.e. a IconSet contains variants for different sizes and widget states). Icons in an icon factory are named by a stock ID, which is a simple string identifying the icon. Each Style has a list of IconFactory derived from the current theme; those icon factories are consulted first when searching for an icon. If the theme doesn't set a particular icon, Gtk+ looks for the icon in a list of default icon factories, maintained by iconFactoryAddDefault and iconFactoryRemoveDefault. Applications with icons should add a default icon factory with their icons, which will allow themes to override the icons for the application. To display an icon, always use styleLookupIconSet on the widget that will display the icon, or the convenience function widgetRenderIcon. These functions take the theme into account when looking up the icon to use for a given stock ID. | |||||||||||||||
Class Hierarchy | |||||||||||||||
| GObject | +----IconFactory | |||||||||||||||
Types | |||||||||||||||
data IconFactory | |||||||||||||||
| |||||||||||||||
class GObjectClass o => IconFactoryClass o | |||||||||||||||
| |||||||||||||||
castToIconFactory :: GObjectClass obj => obj -> IconFactory | |||||||||||||||
toIconFactory :: IconFactoryClass o => o -> IconFactory | |||||||||||||||
Constructors | |||||||||||||||
iconFactoryNew :: IO IconFactory | |||||||||||||||
Create a new IconFactory.
| |||||||||||||||
Methods | |||||||||||||||
iconFactoryAdd :: IconFactory -> String -> IconSet -> IO () | |||||||||||||||
Add an IconSet to an IconFactory. In order to use the new stock object, the factory as to be added to the default factories by iconFactoryAddDefault. | |||||||||||||||
iconFactoryAddDefault :: IconFactory -> IO () | |||||||||||||||
Add all entries of the IconFactory to the applications stock object database. | |||||||||||||||
iconFactoryLookup :: IconFactory -> String -> IO (Maybe IconSet) | |||||||||||||||
Looks up the stock id in the icon factory, returning an icon set if found, otherwise Nothing. For display to the user, you should use styleLookupIconSet on the Style for the widget that will display the icon, instead of using this function directly, so that themes are taken into account. | |||||||||||||||
iconFactoryLookupDefault :: String -> IO (Maybe IconSet) | |||||||||||||||
Looks for an icon in the list of default icon factories. For display to the user, you should use styleLookupIconSet on the Style for the widget that will display the icon, instead of using this function directly, so that themes are taken into account. | |||||||||||||||
iconFactoryRemoveDefault :: IconFactory -> IO () | |||||||||||||||
Remove an IconFactory from the application's stock database. | |||||||||||||||
data IconSet | |||||||||||||||
iconSetNew :: IO IconSet | |||||||||||||||
Create a new IconSet.
| |||||||||||||||
iconSetNewFromPixbuf :: Pixbuf -> IO IconSet | |||||||||||||||
Creates a new IconSet with the given pixbuf as the default/fallback source image. If you don't add any additional IconSource to the icon set, all variants of the icon will be created from the pixbuf, using scaling, pixelation, etc. as required to adjust the icon size or make the icon look insensitive/prelighted. | |||||||||||||||
iconSetAddSource :: IconSet -> IconSource -> IO () | |||||||||||||||
Add an IconSource (an Icon with attributes) to an IconSet.
| |||||||||||||||
iconSetRenderIcon :: WidgetClass widget => IconSet -> TextDirection -> StateType -> IconSize -> widget -> IO Pixbuf | |||||||||||||||
iconSetGetSizes :: IconSet -> IO [IconSize] | |||||||||||||||
Obtains a list of icon sizes this icon set can render. | |||||||||||||||
data IconSource | |||||||||||||||
iconSourceNew :: IO IconSource | |||||||||||||||
Create a new IconSource.
| |||||||||||||||
data TextDirection | |||||||||||||||
| |||||||||||||||
iconSourceGetDirection :: IconSource -> IO (Maybe TextDirection) | |||||||||||||||
Retrieve the TextDirection of this IconSource.
| |||||||||||||||
iconSourceSetDirection :: IconSource -> TextDirection -> IO () | |||||||||||||||
Mark this IconSource that it should only apply to the specified TextDirection. | |||||||||||||||
iconSourceResetDirection :: IconSource -> IO () | |||||||||||||||
Reset the specific TextDirection set with iconSourceSetDirection. | |||||||||||||||
iconSourceGetFilename :: IconSource -> IO (Maybe String) | |||||||||||||||
Retrieve the filename this IconSource was based on.
| |||||||||||||||
iconSourceSetFilename :: IconSource -> FilePath -> IO () | |||||||||||||||
Load an icon picture from this filename. | |||||||||||||||
iconSourceGetPixbuf :: IconSource -> IO (Maybe Pixbuf) | |||||||||||||||
Retrieves the source pixbuf, or Nothing if none is set. | |||||||||||||||
iconSourceSetPixbuf :: IconSource -> Pixbuf -> IO () | |||||||||||||||
Sets a pixbuf to use as a base image when creating icon variants for IconSet. | |||||||||||||||
iconSourceGetSize :: IconSource -> IO (Maybe IconSize) | |||||||||||||||
Retrieve the IconSize of this IconSource.
| |||||||||||||||
iconSourceSetSize :: IconSource -> IconSize -> IO () | |||||||||||||||
Set this IconSource to a specific size. | |||||||||||||||
iconSourceResetSize :: IconSource -> IO () | |||||||||||||||
Reset the IconSize of this IconSource so that is matches anything. | |||||||||||||||
data StateType | |||||||||||||||
| |||||||||||||||
iconSourceGetState :: IconSource -> IO (Maybe StateType) | |||||||||||||||
Retrieve the StateType of this IconSource.
| |||||||||||||||
iconSourceSetState :: IconSource -> StateType -> IO () | |||||||||||||||
Mark this icon to be used only with this specific state. | |||||||||||||||
iconSourceResetState :: IconSource -> IO () | |||||||||||||||
Reset the StateType of this IconSource so that is matches anything. | |||||||||||||||
type IconSize = Int | |||||||||||||||
The size of an icon in pixels. | |||||||||||||||
iconSizeInvalid :: IconSize | |||||||||||||||
Don't scale but use any of the available sizes. | |||||||||||||||
iconSizeMenu :: IconSize | |||||||||||||||
Icon size to use in next to menu items in drop-down menus. | |||||||||||||||
iconSizeSmallToolbar :: IconSize | |||||||||||||||
Icon size for small toolbars. | |||||||||||||||
iconSizeLargeToolbar :: IconSize | |||||||||||||||
Icon size for larger toolbars. | |||||||||||||||
iconSizeButton :: IconSize | |||||||||||||||
Icon size for icons in buttons, next to the label. | |||||||||||||||
iconSizeDialog :: IconSize | |||||||||||||||
Icon size for icons next to dialog text. | |||||||||||||||
iconSizeCheck :: IconSize -> IO Bool | |||||||||||||||
Check if a given IconSize is registered.
| |||||||||||||||
iconSizeRegister :: Int -> String -> Int -> IO IconSize | |||||||||||||||
Register a new IconSize. | |||||||||||||||
iconSizeRegisterAlias :: IconSize -> String -> IO () | |||||||||||||||
Register an additional alias for a name. | |||||||||||||||
iconSizeFromName :: String -> IO IconSize | |||||||||||||||
Lookup an IconSize by name.
| |||||||||||||||
iconSizeGetName :: IconSize -> IO (Maybe String) | |||||||||||||||
Lookup the name of an IconSize.
| |||||||||||||||
Produced by Haddock version 0.8 |