gtkmm 3.24.10

Public Member Functions | Static Public Member Functions | Protected Attributes | Related Symbols | List of all members
Gtk::IconSource Class Reference

`#include <gtkmm/iconsource.h>`

## Public Member Functions
| IconSource ()
| IconSource (GtkIconSource * gobject, bool make_a_copy=true)
| IconSource (const IconSource & other)
IconSource & | operator= (const IconSource & other)
| IconSource (IconSource && other) noexcept
IconSource & | operator= (IconSource && other) noexcept
| ~IconSource () noexcept
void | swap (IconSource & other) noexcept
GtkIconSource * | gobj ()
| Provides access to the underlying C instance.
const GtkIconSource * | gobj () const
| Provides access to the underlying C instance.
GtkIconSource * | gobj_copy () const
| Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
void | set_filename (const Glib::ustring & filename)
| Sets the name of an image file to use as a base image when creating icon variants for Gtk::IconSet.
void | set_pixbuf (const Glib::RefPtr< Gdk::Pixbuf > & pixbuf)
| Sets a pixbuf to use as a base image when creating icon variants for Gtk::IconSet.
Glib::ustring | get_filename () const
| Retrieves the source filename, or nullptr if none is set.
Glib::RefPtr< Gdk::Pixbuf > | get_pixbuf ()
| Retrieves the source pixbuf, or nullptr if none is set.
Glib::RefPtr< const Gdk::Pixbuf > | get_pixbuf () const
| Retrieves the source pixbuf, or nullptr if none is set.
void | set_direction_wildcarded (bool setting=true)
| If the text direction is wildcarded, this source can be used as the base image for an icon in any Gtk::TextDirection.
void | set_state_wildcarded (bool setting=true)
| If the widget state is wildcarded, this source can be used as the base image for an icon in any Gtk::StateType.
void | set_size_wildcarded (bool setting=true)
| If the icon size is wildcarded, this source can be used as the base image for an icon of any size.
bool | get_size_wildcarded () const
| Gets the value set by set_size_wildcarded().
bool | get_state_wildcarded () const
| Gets the value set by set_state_wildcarded().
bool | get_direction_wildcarded () const
| Gets the value set by set_direction_wildcarded().
void | set_direction (TextDirection direction)
| Sets the text direction this icon source is intended to be used with.
void | set_state (Gtk::StateType state)
| Sets the widget state this icon source is intended to be used with.
void | set_size (IconSize size)
| Sets the icon size this icon source is intended to be used with.
TextDirection | get_direction () const
| Obtains the text direction this icon source applies to.
Gtk::StateType | get_state () const
| Obtains the widget state this icon source applies to.
IconSize | get_size () const
| Obtains the icon size this source applies to.
void | set_icon_name (const Glib::ustring & icon_name)
| Sets the name of an icon to look up in the current icon theme to use as a base image when creating icon variants for Gtk::IconSet.
Glib::ustring | get_icon_name () const
| Retrieves the source icon name, or nullptr if none is set.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.

## Protected Attributes
GtkIconSource * | gobject_

## Related Symbols
(Note that these are not member symbols.)
void | swap (IconSource & lhs, IconSource & rhs) noexcept
Gtk::IconSource | wrap (GtkIconSource * object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Deprecated
  Use Gtk::IconTheme instead.

## Constructor & Destructor Documentation

## ◆ IconSource() [1/4]

Gtk::IconSource::IconSource | ( |  | ) |

## ◆ IconSource() [2/4]

Gtk::IconSource::IconSource | ( | GtkIconSource * | gobject,
|  | bool | make_a_copy = true )
| explicit

## ◆ IconSource() [3/4]

Gtk::IconSource::IconSource | ( | const IconSource & | other | ) |

## ◆ IconSource() [4/4]

Gtk::IconSource::IconSource | ( | IconSource && | other | ) |
| noexcept

## ◆ ~IconSource()

Gtk::IconSource::~IconSource | ( |  | ) |
| noexcept

## Member Function Documentation

## ◆ get_direction()

TextDirection Gtk::IconSource::get_direction | ( |  | ) | const

Obtains the text direction this icon source applies to.

The return value is only useful/meaningful if the text direction is not wildcarded.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Text direction this source matches.

## ◆ get_direction_wildcarded()

bool Gtk::IconSource::get_direction_wildcarded | ( |  | ) | const

Gets the value set by set_direction_wildcarded().

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  true if this icon source is a base for any text direction variant.

## ◆ get_filename()

Glib::ustring Gtk::IconSource::get_filename | ( |  | ) | const

Retrieves the source filename, or nullptr if none is set.

The filename is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Image filename. This string must not be modified or freed.

## ◆ get_icon_name()

Glib::ustring Gtk::IconSource::get_icon_name | ( |  | ) | const

Retrieves the source icon name, or nullptr if none is set.

The icon_name is not a copy, and should not be modified or expected to persist beyond the lifetime of the icon source.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Icon name. This string must not be modified or freed.

## ◆ get_pixbuf() [1/2]

Glib::RefPtr< Gdk::Pixbuf > Gtk::IconSource::get_pixbuf | ( |  | ) |

Retrieves the source pixbuf, or nullptr if none is set.

In addition, if a filename source is in use, this function in some cases will return the pixbuf from loaded from the filename. This is, for example, true for the GtkIconSource passed to the Gtk::Style render_icon() virtual function. The reference count on the pixbuf is not incremented.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Source pixbuf.

## ◆ get_pixbuf() [2/2]

Glib::RefPtr< const Gdk::Pixbuf > Gtk::IconSource::get_pixbuf | ( |  | ) | const

Retrieves the source pixbuf, or nullptr if none is set.

In addition, if a filename source is in use, this function in some cases will return the pixbuf from loaded from the filename. This is, for example, true for the GtkIconSource passed to the Gtk::Style render_icon() virtual function. The reference count on the pixbuf is not incremented.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Source pixbuf.

## ◆ get_size()

IconSize Gtk::IconSource::get_size | ( |  | ) | const

Obtains the icon size this source applies to.

The return value is only useful/meaningful if the icon size is not wildcarded.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Icon size (Gtk::IconSize) this source matches.

## ◆ get_size_wildcarded()

bool Gtk::IconSource::get_size_wildcarded | ( |  | ) | const

Gets the value set by set_size_wildcarded().

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  true if this icon source is a base for any icon size variant.

## ◆ get_state()

Gtk::StateType Gtk::IconSource::get_state | ( |  | ) | const

Obtains the widget state this icon source applies to.

The return value is only useful/meaningful if the widget state is not wildcarded.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  Widget state this source matches.

## ◆ get_state_wildcarded()

bool Gtk::IconSource::get_state_wildcarded | ( |  | ) | const

Gets the value set by set_state_wildcarded().

Deprecated: 3.10: Use Gtk::IconTheme instead.

Returns
  true if this icon source is a base for any widget state variant.

## ◆ get_type()

GType Gtk::IconSource::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GtkIconSource * Gtk::IconSource::gobj | ( |  | ) |
| inline

Provides access to the underlying C instance.

## ◆ gobj() [2/2]

const GtkIconSource * Gtk::IconSource::gobj | ( |  | ) | const
| inline

Provides access to the underlying C instance.

## ◆ gobj_copy()

GtkIconSource * Gtk::IconSource::gobj_copy | ( |  | ) | const

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

## ◆ operator=() [1/2]

IconSource & Gtk::IconSource::operator= | ( | const IconSource & | other | ) |

## ◆ operator=() [2/2]

IconSource & Gtk::IconSource::operator= | ( | IconSource && | other | ) |
| noexcept

## ◆ set_direction()

void Gtk::IconSource::set_direction | ( | TextDirection | direction | ) |

Sets the text direction this icon source is intended to be used with.

Setting the text direction on an icon source makes no difference if the text direction is wildcarded. Therefore, you should usually call set_direction_wildcarded() to un-wildcard it in addition to calling this function.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  direction | Text direction this source applies to.

## ◆ set_direction_wildcarded()

void Gtk::IconSource::set_direction_wildcarded | ( | bool | setting = true | ) |

If the text direction is wildcarded, this source can be used as the base image for an icon in any Gtk::TextDirection.

If the text direction is not wildcarded, then the text direction the icon source applies to should be set with set_direction(), and the icon source will only be used with that text direction.

Gtk::IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  setting | true to wildcard the text direction.

## ◆ set_filename()

void Gtk::IconSource::set_filename | ( | const Glib::ustring & | filename | ) |

Sets the name of an image file to use as a base image when creating icon variants for Gtk::IconSet.

The filename must be absolute.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  filename | Image file to use.

## ◆ set_icon_name()

void Gtk::IconSource::set_icon_name | ( | const Glib::ustring & | icon_name | ) |

Sets the name of an icon to look up in the current icon theme to use as a base image when creating icon variants for Gtk::IconSet.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  icon_name | Name of icon to use.

## ◆ set_pixbuf()

void Gtk::IconSource::set_pixbuf | ( | const Glib::RefPtr< Gdk::Pixbuf > & | pixbuf | ) |

Sets a pixbuf to use as a base image when creating icon variants for Gtk::IconSet.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  pixbuf | Pixbuf to use as a source.

## ◆ set_size()

void Gtk::IconSource::set_size | ( | IconSize | size | ) |

Sets the icon size this icon source is intended to be used with.

Setting the icon size on an icon source makes no difference if the size is wildcarded. Therefore, you should usually call set_size_wildcarded() to un-wildcard it in addition to calling this function.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  size | Icon size (Gtk::IconSize) this source applies to.

## ◆ set_size_wildcarded()

void Gtk::IconSource::set_size_wildcarded | ( | bool | setting = true | ) |

If the icon size is wildcarded, this source can be used as the base image for an icon of any size.

If the size is not wildcarded, then the size the source applies to should be set with set_size() and the icon source will only be used with that specific size.

Gtk::IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

Gtk::IconSet will normally scale wildcarded source images to produce an appropriate icon at a given size, but will not change the size of source images that match exactly.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  setting | true to wildcard the widget state.

## ◆ set_state()

void Gtk::IconSource::set_state | ( | Gtk::StateType | state | ) |

Sets the widget state this icon source is intended to be used with.

Setting the widget state on an icon source makes no difference if the state is wildcarded. Therefore, you should usually call set_state_wildcarded() to un-wildcard it in addition to calling this function.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  state | Widget state this source applies to.

## ◆ set_state_wildcarded()

void Gtk::IconSource::set_state_wildcarded | ( | bool | setting = true | ) |

If the widget state is wildcarded, this source can be used as the base image for an icon in any Gtk::StateType.

If the widget state is not wildcarded, then the state the source applies to should be set with set_state() and the icon source will only be used with that specific state.

Gtk::IconSet prefers non-wildcarded sources (exact matches) over wildcarded sources, and will use an exact match when possible.

Gtk::IconSet will normally transform wildcarded source images to produce an appropriate icon for a given state, for example lightening an image on prelight, but will not modify source images that match exactly.

Deprecated: 3.10: Use Gtk::IconTheme instead.

Parameters

  setting | true to wildcard the widget state.

## ◆ swap()

void Gtk::IconSource::swap | ( | IconSource & | other | ) |
| noexcept

## Friends And Related Symbol Documentation

## ◆ swap()

void swap | ( | IconSource & | lhs,
|  | IconSource & | rhs )
| related

Parameters

  lhs | The left-hand side
  rhs | The right-hand side

## ◆ wrap()

Gtk::IconSource wrap | ( | GtkIconSource * | 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.

## Member Data Documentation

## ◆ gobject_

GtkIconSource* Gtk::IconSource::gobject_
| protected