Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# iconfactory.hh File Reference

A GtkIconFactory C++ wrapper interface. More...

`#include <xfc/glib/object.hh>`
`#include <xfc/gtk/iconset.hh>`
`#include <xfc/gtk/stockid.hh>`
`#include <xfc/gtk/inline/iconfactory.inl>`

## Namespaces

- namespace Xfc
- namespace Xfc::Gdk
- namespace Xfc::Gtk

## Classes

- class Xfc::Gtk::IconFactory
    A GtkIconFactory C++ wrapper class. More...

## Icon Size Methods

- bool icon_size_lookup (IconSize size, int *width, int *height, Settings *settings=0)
    Obtains the pixel size of a semantic icon size, possibly modified by user preferences for a particular Settings.
- IconSize icon_size_register (const String &name, int width, int height)
    Registers a new icon size, along the same lines as ICON_SIZE_MENU, etc.
- void icon_size_register_alias (const String &alias, IconSize target)
    Registers alias as another name for target.
- IconSize icon_size_from_name (const String &name)
    Looks up the icon size associated with name.
- String icon_size_get_name (IconSize size)
    Gets the canonical name of the given icon size.

## Detailed Description

A GtkIconFactory C++ wrapper interface.

Provides IconFactory, an object that manages a collection of IconSets.

## Function Documentation

IconSize icon_size_from_name | ( | const String & | name | ) |

Looks up the icon size associated with name.

Parameters:

  | name | The name to look up.

Returns:
  The icon size with the given name.

String icon_size_get_name | ( | IconSize | size | ) |

Gets the canonical name of the given icon size.

Parameters:

  | size | An IconSize.

Returns:
  The name of the given icon size.

bool icon_size_lookup | ( | IconSize | size,
|  | int * | width,
|  | int * | height,
|  | Settings * | settings = `0`
| ) |

Obtains the pixel size of a semantic icon size, possibly modified by user preferences for a particular Settings.

Parameters:

  | size | An icon size.
  | width | The location to store icon width.
  | height | The location to store icon height.
  | settings | A Settings object, used to determine which set of user preferences to use, or null to use the settings for the default screen.

Returns:
  true if size was a valid size.

Normally size would be ICON_SIZE_MENU, ICON_SIZE_BUTTON, etc. This method isn't normally needed, Gtk::Widget::render_icon() is the usual way to get an icon for rendering, then just look at the size of the rendered pixbuf. The rendered pixbuf may not even correspond to the width/height returned by size_lookup(), because themes are free to render the pixbuf however they like, including changing the usual size.

Note: The default GDK screen is the only screen in the absence of MultiHead support.

IconSize icon_size_register | ( | const String & | name,
|  | int | width,
|  | int | height
| ) |

Registers a new icon size, along the same lines as ICON_SIZE_MENU, etc.

Parameters:

  | name | The name of the icon size.
  | width | The icon width.
  | height | The icon height.

Returns:
  The integer value for the size, as an IconSize.

void icon_size_register_alias | ( | const String & | alias,
|  | IconSize | target
| ) |

Registers alias as another name for target.

Parameters:

  | alias | An alias for target.
  | target | An existing icon size.

Calling size_from_name() with alias as the argument will return target.

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3