FX::FXIconDict Class Reference

#include <FXIconDict.h>

Inheritance diagram for FX::FXIconDict:

Inheritance graph
[legend]

List of all members.


Detailed Description

The Icon Dictionary 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 dictionary, and thus all icons will be deleted when the dictionary is deleted.

Public Member Functions

 FXIconDict (FXApp *app, const FXString &p=defaultIconPath)
void setIconSource (FXIconSource *src)
FXIconSourcegetIconSource () const
void setIconPath (const FXString &p)
const FXStringgetIconPath () const
FXIconinsert (const FXchar *name)
FXIconremove (const FXchar *name)
FXIconfind (const FXchar *name)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
virtual ~FXIconDict ()
void size (FXint m)
FXint size () const
FXint no () const
void * insert (const FXchar *ky, const void *ptr, bool mrk=false)
void * replace (const FXchar *ky, const void *ptr, bool mrk=false)
void * find (const FXchar *ky) const
bool empty (FXint pos) const
const FXchar * key (FXuint pos) const
void * data (FXuint pos) const
bool mark (FXuint pos) const
FXint first () const
FXint last () const
FXint next (FXint pos) const
FXint prev (FXint pos) const
void clear ()
virtual long onDefault (FXObject *, FXSelector, void *)
const FXchar * getClassName () const
bool isMemberOf (const FXMetaClass *metaclass) const
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
QTransString tr (const char *text, const char *hint=0)
virtual void * getPythonObject () const
virtual void decouplePythonObject () const

Static Public Attributes

static const FXchar defaultIconPath []

Protected Member Functions

virtual void * createData (const void *)
virtual void deleteData (void *)

Static Protected Member Functions

static FXint hash (const FXchar *str)

Protected Attributes

FXDictEntry * dict
FXint total
FXint number

Constructor & Destructor Documentation

FX::FXIconDict::FXIconDict ( FXApp app,
const FXString p = defaultIconPath 
)

Construct icon dictionary, and set initial search path; also creates a default icon source object.

virtual FX::FXIconDict::~FXIconDict (  )  [virtual]

Destroy the icon dict as well as the icon source.


Member Function Documentation

virtual void* FX::FXIconDict::createData ( const void *   )  [protected, virtual]

Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer.

Reimplemented from FX::FXDict.

virtual void FX::FXIconDict::deleteData ( void *   )  [protected, virtual]

Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing.

Reimplemented from FX::FXDict.

void FX::FXIconDict::setIconSource ( FXIconSource src  )  [inline]

Change icon source.

FXIconSource* FX::FXIconDict::getIconSource (  )  const [inline]

Return icon source.

void FX::FXIconDict::setIconPath ( const FXString p  )  [inline]

Set icon search path.

const FXString& FX::FXIconDict::getIconPath (  )  const [inline]

Return current icon search path.

FXIcon* FX::FXIconDict::insert ( const FXchar *  name  )  [inline]

Insert unique icon loaded from filename into dictionary.

References FX::FXDict::insert().

FXIcon* FX::FXIconDict::remove ( const FXchar *  name  )  [inline]

Remove icon from dictionary.

Reimplemented from FX::FXDict.

References FX::FXDict::remove().

FXIcon* FX::FXIconDict::find ( const FXchar *  name  )  [inline]

Find icon by name.

References FX::FXDict::find().

virtual void FX::FXIconDict::save ( FXStream store  )  const [virtual]

Save to stream.

Reimplemented from FX::FXObject.

virtual void FX::FXIconDict::load ( FXStream store  )  [virtual]

Load from stream.

Reimplemented from FX::FXObject.

void FX::FXDict::size ( FXint  m  )  [inherited]

Resize the table to the given size.

FXint FX::FXDict::size (  )  const [inline, inherited]

Return the size of the table, including the empty slots.

FXint FX::FXDict::no (  )  const [inline, inherited]

Return the total number of entries in the table.

void* FX::FXDict::insert ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
) [inherited]

Insert a new entry into the table given key and mark. If there is already an entry with that key, leave it unchanged, otherwise insert the new entry.

Referenced by FX::FXStringDict::insert(), and insert().

void* FX::FXDict::replace ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
) [inherited]

Replace data at key, if the entry's mark is less than or equal to the given mark. If there was no existing entry, a new entry is inserted with the given mark.

Referenced by FX::FXStringDict::replace().

void* FX::FXDict::find ( const FXchar *  ky  )  const [inherited]

Find data pointer given key.

Reimplemented in FX::FXSettings, and FX::FXStringDict.

Referenced by FX::FXStringDict::find(), FX::FXSettings::find(), and find().

bool FX::FXDict::empty ( FXint  pos  )  const [inline, inherited]

Return true if slot is empty.

const FXchar* FX::FXDict::key ( FXuint  pos  )  const [inline, inherited]

Return key at position pos.

void* FX::FXDict::data ( FXuint  pos  )  const [inline, inherited]

return data pointer at position pos.

Reimplemented in FX::FXSettings, and FX::FXStringDict.

Referenced by FX::FXSettings::data().

bool FX::FXDict::mark ( FXuint  pos  )  const [inline, inherited]

Return mark flag of entry at position pos.

FXint FX::FXDict::first (  )  const [inherited]

Return position of first filled slot, or >= total

FXint FX::FXDict::last (  )  const [inherited]

Return position of last filled slot or -1

FXint FX::FXDict::next ( FXint  pos  )  const [inherited]

Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found

FXint FX::FXDict::prev ( FXint  pos  )  const [inherited]

Return position of previous filled slot in hash table or a -1 if no filled slot was found

void FX::FXDict::clear (  )  [inherited]

Clear all entries.

Reimplemented in FX::FXSettings.

virtual long FX::FXObject::onDefault ( FXObject ,
FXSelector  ,
void *   
) [virtual, inherited]

Called for unhandled messages.

Reimplemented in FX::FXDelegator, FX::FXGLViewer, FX::FXMDIChild, and FX::FXMDIClient.

const FXchar* FX::FXObject::getClassName (  )  const [inherited]

Get class name of some object.

bool FX::FXObject::isMemberOf ( const FXMetaClass metaclass  )  const [inherited]

Check if object is member of metaclass.

virtual long FX::FXObject::tryHandle ( FXObject sender,
FXSelector  sel,
void *  ptr 
) [virtual, inherited]

Try handle message safely.

QTransString FX::FXObject::tr ( const char *  text,
const char *  hint = 0 
) [inherited]

Returns a human translated version of the text to the locale language (warning: uses a virtual method call, so can't use before construction)

virtual void* FX::FXObject::getPythonObject (  )  const [inline, virtual, inherited]

Returns the python object representing this instance (if created in python).

virtual void FX::FXObject::decouplePythonObject (  )  const [inline, virtual, inherited]

Causes decoupling of python object from this object (deletes self).


Member Data Documentation

const FXchar FX::FXIconDict::defaultIconPath[] [static]

Default icon search path.


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:01:32 2008 for TnFOX by doxygen v1.5.6