glibmm: Gio::ThemedIcon Class Reference

glibmm 2.31.18.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions
Gio::ThemedIcon Class Reference

Icon theming support ThemedIcon is an implementation of Gio::Icon that supports icon themes. More...

`#include <giomm/themedicon.h>`

Inheritance diagram for Gio::ThemedIcon:
[legend]

List of all members.

## Public Member Functions
virtual | ~ThemedIcon ()
GThemedIcon* | gobj ()
| Provides access to the underlying C GObject.
const GThemedIcon* | gobj () const
| Provides access to the underlying C GObject.
GThemedIcon* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | prepend_name (const std::string& iconname)
| Prepend a name to the list of icons from within icon.
void | append_name (const std::string& iconname)
| Append a name to the list of icons from within icon.
Glib::StringArrayHandle | get_names () const
Glib::PropertyProxy_ReadOnly < bool > | property_use_default_fallbacks () const
| You rarely need to use properties because there are get_ and set_ methods for almost all of them.
## Static Public Member Functions
static Glib::RefPtr< ThemedIcon > | create (const std::string& iconname, bool use_default_callbacks=false)
| Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening iconname at '-' characters.
## Protected Member Functions
| ThemedIcon (const std::string& iconname, bool use_default_callbacks=false)
| Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening iconname at '-' characters.
## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gio::ThemedIcon > | wrap (GThemedIcon* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Icon theming support ThemedIcon is an implementation of Gio::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::IconTheme::choose_icon() should be used to resolve the list of names so that fallback icons work nicely with themes that inherit other themes.

Since glibmm 2.16:

## Constructor & Destructor Documentation

virtual Gio::ThemedIcon::~ThemedIcon | ( |  | ) | `[virtual]`

Gio::ThemedIcon::ThemedIcon | ( | const std::string & | iconname,
|  | bool | use_default_callbacks = `false`
| ) |  | `[explicit, protected]`

Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening iconname at '-' characters.

Parameters:

  iconname | A string containing an icon name. use_default_callbacks Whether to use all the names that can be created by shortening iconname at '-' characters.

## Member Function Documentation

void Gio::ThemedIcon::append_name | ( | const std::string & | iconname | ) |

Append a name to the list of icons from within icon.

<note> Note that doing so invalidates the hash computed by prior calls to g_icon_hash(). </note>

Parameters:

  iconname | Name of icon to append to list of icons from within icon.

static Glib::RefPtr<ThemedIcon> Gio::ThemedIcon::create | ( | const std::string & | iconname,
|  | bool | use_default_callbacks = `false`
| ) |  | `[static]`

Creates a new themed icon for @ iconname, and optionally all the names that can be created by shortening iconname at '-' characters.

Parameters:

  iconname | A string containing an icon name. use_default_callbacks Whether to use all the names that can be created by shortening iconname at '-' characters.

Glib::StringArrayHandle Gio::ThemedIcon::get_names | ( |  | ) | const

GThemedIcon* Gio::ThemedIcon::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Icon.

const GThemedIcon* Gio::ThemedIcon::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Icon.

GThemedIcon* Gio::ThemedIcon::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

void Gio::ThemedIcon::prepend_name | ( | const std::string & | iconname | ) |

Prepend a name to the list of icons from within icon.

<note> Note that doing so invalidates the hash computed by prior calls to g_icon_hash(). </note>

Since glibmm 2.18:

Parameters:

  iconname | Name of icon to prepend to list of icons from within icon.

Glib::PropertyProxy_ReadOnly< bool > Gio::ThemedIcon::property_use_default_fallbacks | ( |  | ) | const

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

## Friends And Related Function Documentation

Glib::RefPtr< Gio::ThemedIcon > wrap | ( | GThemedIcon * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.