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

# Xfc::Gtk::IconInfo Class Reference

A GtkIconInfo C++ wrapper class. More...

`#include <xfc/gtk/icontheme.hh>`

Inheritance diagram for Xfc::Gtk::IconInfo:

List of all members.

## Public Member Functions

Constructors

- IconInfo (GtkIconInfo *icon_info)
    Construct a new IconInfo from an existing GtkIconInfo.
- IconInfo (GtkIconInfo *icon_info, bool copy)
    Construct a new IconInfo from an existing GtkIconInfo.
- IconInfo (const IconInfo &src)
    Copy constructor.
- ~IconInfo ()
    Destructor.
- IconInfo & operator= (const IconInfo &src)
    Assignment operator.

Accessors

- GtkIconInfo * gtk_icon_info () const
    Get a pointer to the GtkIconInfo structure.
- operator GtkIconInfo * () const
    Conversion operator; safely converts a IconInfo to a GtkIconInfo pointer.
- int get_base_size () const
    Gets the base size for the icon.
- String get_filename () const
    Gets the filename for the icon.
- Gdk::Pixbuf * get_builtin_pixbuf () const
    Gets the built-in image for this icon, if any.
- bool get_embedded_rect (Gdk::Rectangle &rectangle) const
    Gets the coordinates of a rectangle within the icon that can be used for display of information such as a preview of the contents of a text file (see set_raw_coordinates() for further information about the coordinate system).
- std::vector< Gdk::Point > get_attach_points () const
    Fetches the set of attach points for an icon.
- bool has_attach_points () const
    Determines whether there are any attach points for the icon.
- String get_display_name () const
    Gets the display name for an icon.

Methods

- Pointer< Gdk::Pixbuf > load_icon (G::Error *error=0)
    The size will be based on the size passed to Gtk::IconTheme::lookup_icon().
- void set_raw_coordinates (bool raw_coordinates)
    Sets whether the coordinates returned by get_embedded_rect() and get_attach_points() should be returned in their original form as specified in the icon theme, instead of scaled appropriately for the pixbuf returned by load_icon().

## Detailed Description

A GtkIconInfo C++ wrapper class.

IconInfo contains information found when looking up an icon in an icon theme with Gtk::IconTheme::look_up().

## Constructor & Destructor Documentation

Xfc::Gtk::IconInfo::IconInfo | ( | GtkIconInfo * | icon_info | ) | `[explicit]`

  | Construct a new IconInfo from an existing GtkIconInfo. Parameters:
  | icon_info | A GtkIconInfo.
This constructor creates a temporary wrapper for a GtkIconInfo. It neither copies the GtkIconInfo or takes over its ownership. The IconInfo is created with a reference count of 1 that the caller owns.

Xfc::Gtk::IconInfo::IconInfo | ( | GtkIconInfo * | icon_info,
|  | bool | copy
| ) |

  | Construct a new IconInfo from an existing GtkIconInfo. Parameters:
  | icon_info | A GtkIconInfo.
  | copy | true if a copy of GtkIconInfo should be made.
This constructor either takes over the ownership of the GtkIconInfo, or makes a copy of the GtkIconInfo. The IconInfo is created with a reference count of 1 that the caller owns. This constructor is primarily intended for use by the G::Boxed::wrap() method.

## Member Function Documentation

std::vector<Gdk::Point> Xfc::Gtk::IconInfo::get_attach_points | ( |  | ) | const

| Fetches the set of attach points for an icon. Returns: A vector of Gdk::Point that holds the attach points. An attach point is a location in the icon that can be used as anchor points for attaching emblems or overlays to the icon.

int Xfc::Gtk::IconInfo::get_base_size | ( |  | ) | const

| Gets the base size for the icon. Returns: The base size, or 0, if no base size is known for the icon. The base size is a size for the icon that was specified by the icon theme creator. This may be different than the actual size of image; an example of this is small emblem icons that can be attached to a larger icon. These icons will be given the same base size as the larger icons to which they are attached.

Gdk::Pixbuf* Xfc::Gtk::IconInfo::get_builtin_pixbuf | ( |  | ) | const

| Gets the built-in image for this icon, if any. Returns: The built-in image pixbuf, or null. To allow GTK+ to use built in icon images, you must pass the Gtk::ICON_LOOKUP_USE_BUILTIN to Gtk::IconTheme::lookup_icon().

String Xfc::Gtk::IconInfo::get_display_name | ( |  | ) | const

| Gets the display name for an icon. Returns: The display name for the icon, or null if the icon doesn't have a specified display name. A display name is a string to be used in place of the icon name in a user visible context like a list of icons.

bool Xfc::Gtk::IconInfo::get_embedded_rect | ( | Gdk::Rectangle & | rectangle | ) | const

  | Gets the coordinates of a rectangle within the icon that can be used for display of information such as a preview of the contents of a text file (see set_raw_coordinates() for further information about the coordinate system). Parameters:
  | rectangle | A Gdk::Rectangle in which to store embedded rectangle coordinates.
Returns: true if the icon has an embedded rectangle. Coordinates are only stored when this function returns true.

String Xfc::Gtk::IconInfo::get_filename | ( |  | ) | const

| Gets the filename for the icon. Returns: The filename for the icon, or null if get_builtin_pixbuf() should be used instead. If the Gtk::ICON_LOOKUP_USE_BUILTIN flag was passed to Gtk::IconTheme::lookup_icon(), there may be no filename if a builtin icon is returned; in this case, you should use get_builtin_pixbuf().

bool Xfc::Gtk::IconInfo::has_attach_points | ( |  | ) | const

| Determines whether there are any attach points for the icon. Returns: true if there are any attach points for the icon.

Pointer<Gdk::Pixbuf> Xfc::Gtk::IconInfo::load_icon | ( | G::Error * | error = `0` | ) |

  | The size will be based on the size passed to Gtk::IconTheme::lookup_icon(). Parameters:
  | error | The location to store error information on failure, or null.
Returns: A smart pointer to the rendered icon, or null if the icon isn't found. Note that the resulting pixbuf may not be exactly this size; an icon theme may have icons that differ slightly from their nominal sizes, and in addition GTK+ will avoid scaling icons that it considers sufficiently close to the requested size (this maintains sharpness). The rendered icon may be a newly created icon or a new reference to an internal icon, so you must not modify the icon.

void Xfc::Gtk::IconInfo::set_raw_coordinates | ( | bool | raw_coordinates | ) |

  | Sets whether the coordinates returned by get_embedded_rect() and get_attach_points() should be returned in their original form as specified in the icon theme, instead of scaled appropriately for the pixbuf returned by load_icon(). Parameters:
  | raw_coordinates | Whether the coordinates of embedded rectangles and attached points should be returned in their original (unscaled) form.
Raw coordinates are somewhat strange; they are specified to be with respect to the unscaled pixmap for PNG and XPM icons, but for SVG icons, they are in a 1000x1000 coordinate space that is scaled to the final size of the icon. You can determine if the icon is an SVG icon by using get_filename(), and seeing if it is non-null and ends in '.svg'. This method is provided primarily to allow compatibility wrappers for older API's, and is not expected to be useful for applications.

The documentation for this class was generated from the following file:

- icontheme.hh

Xfce Foundation Classes

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