Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
The Icon Cache manages a collection of icons. More...
#include <FXIconCache.h>
Public Member Functions | |
FXIconCache (FXApp *ap, const FXString &sp=defaultIconPath) | |
Construct Icon Cache, and set initial search path; also sets a pointer to the default icon source object. | |
FXApp * | getApp () const |
Get application. | |
void | setIconSource (FXIconSource *src) |
Change icon source. | |
FXIconSource * | getIconSource () const |
Return icon source. | |
void | setIconPath (const FXString &p) |
Set the icon search paths. | |
const FXString & | getIconPath () const |
Return the current icon search paths. | |
FXIcon * | insert (const FXchar *name) |
Insert icon into cache, load it from file if not already cached. | |
FXIcon * | insert (const FXString &name) |
Insert icon into cache, load it from file if not already cached. | |
FXIcon * | find (const FXchar *name) const |
Find icon by name, return NULL if no icon found in cache. | |
FXIcon * | find (const FXString &name) const |
Find icon by name, return NULL if no icon found in cache. | |
void | remove (const FXchar *name) |
Remove icon from cache and delete it. | |
void | remove (const FXString &name) |
Remove icon from cache. | |
void | clear () |
Delete all icons. | |
virtual void | save (FXStream &store) const |
Save object to stream. | |
virtual void | load (FXStream &store) |
Load object from stream. | |
virtual | ~FXIconCache () |
Delete everything. | |
Public Member Functions inherited from FX::FXObject | |
const FXchar * | getClassName () const |
Get class name of some object. | |
FXbool | isMemberOf (const FXMetaClass *metaclass) const |
Check if object is member of metaclass. | |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
Try handle message safely, catching certain exceptions. | |
virtual long | onDefault (FXObject *, FXSelector, void *) |
Called for unhandled messages. | |
virtual | ~FXObject () |
Virtual destructor. | |
Static Public Attributes | |
static const FXchar | defaultIconPath [] |
Default icon search path. | |
The Icon Cache manages a collection of icons.
The icons are referenced by their file name. When first encountering a new file name, the icon is located by searching the icon search path for the icon file. If found, the services of the Icon Source object are used to load the icon from the file. A custom Icon Source may be installed to furnish support for additonal image file formats. Once the icon is loaded, an association between the icon name and the icon is entered into the Icon Dictionary. Subsequent searches for an icon with this name will be satisfied from the cached value. The lifetype of the icons is managed by the Icon Cache, and thus all icons will be deleted when the Icon Cache itself is deleted.
Copyright © 1997-2022 Jeroen van der Zijp |