edelib  2.1.0
Public Member Functions | Static Public Member Functions | List of all members
IconTheme Class Reference

Finds named icon according to the given theme. More...

#include <edelib/IconTheme.h>

Public Member Functions

 IconTheme ()
 ~IconTheme ()
void load (const char *name)
void clear (void)
String find_icon (const char *icon, IconSizes size, IconContext context=ICON_CONTEXT_ANY)
const char * theme_name (void) const
const char * stylized_theme_name (void) const
const char * description (void) const
const char * example_icon (void) const
void query_icons (list< String > &lst, IconSizes size, IconContext context=ICON_CONTEXT_ANY) const

Static Public Member Functions

static const char * default_theme_name (void)

Detailed Description

Finds named icon according to the given theme.

IconTheme is icon finder via Icon Theme Specification from http://www.freedesktop.org. This specification prescribes how icons should be located when icon name was given in desktop neutral way. With this, all common desktop environments and apps could share icons and themes.

IconTheme closely follows this specification, with a few minor exceptions:

Icons are searched by giving the icon name, without extension, and IconTheme will try to find either PNG or XPM icon with the same name.

Although this class can be used directly, preferred way is to load icons via IconLoader.

implement Threshold support (see icon-theme spec)

Constructor & Destructor Documentation

IconTheme ( )

Empty constructor

~IconTheme ( )

Destructor, calls clear()

Member Function Documentation

void clear ( void  )

Unload current theme and clear allocated data

static const char* default_theme_name ( void  )

Returns name for default icon theme

const char* description ( void  ) const

Returns description of loaded icon theme. If description wasn't found, returned string will be NULL

const char* example_icon ( void  ) const

Returns the name of example icon or NULL if wasn't found. Example icon is value of Example key and is plain name that could be used with find_icon() to search it's full path

String find_icon ( const char *  icon,
IconSizes  size,
IconContext  context = ICON_CONTEXT_ANY 

Return full path to the icon name. If icon wasn't found, it will return empty string

void load ( const char *  name)

Load theme. Must be called before icons search. Calling load() again with the new theme name will initialize that new theme

void query_icons ( list< String > &  lst,
IconSizes  size,
IconContext  context = ICON_CONTEXT_ANY 
) const

Query available icons from loaded theme and inherited themes. Icons will have full path

const char* stylized_theme_name ( void  ) const

Returns current theme name. The difference between this function and theme_name() is that theme_name() represents what was given to load() function, but stylized_theme_name() is the value of the Name key in index.theme file.

Name is often localized so it should be used to publicly present icon theme name

const char* theme_name ( void  ) const

Returns current given theme name, or NULL if theme wasn't loaded via load()

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