PieDock  1.6.3
Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
PieDock::IconMap Class Reference

#include <IconMap.h>

Public Types

typedef std::vector< std::string > Paths
 

Public Member Functions

virtual ~IconMap ()
 
virtual void addPath (const std::string p)
 
virtual const Paths & getPath () const
 
virtual void setFileForMissing (const std::string f)
 
virtual const std::string & getFileForMissing () const
 
virtual void setFileForFiller (const std::string f)
 
virtual const std::string & getFileForFiller () const
 
virtual void reset ()
 
virtual void addNameAlias (std::string, std::string)
 
virtual void addClassAlias (std::string, std::string)
 
virtual void addTitleAlias (std::string, std::string)
 
virtual IcongetIcon (std::string, std::string, std::string)
 
virtual IcongetIconByName (std::string)
 
virtual IcongetIconByClass (const std::string)
 
virtual IcongetIconByTitle (const std::string)
 
virtual IcongetMissingIcon (const std::string)
 
virtual IcongetFillerIcon ()
 
virtual IconcreateIcon (const ArgbSurface *, const std::string, Icon::Type)
 
virtual void saveIcon (const ArgbSurface *, const std::string) const
 

Protected Types

typedef std::map< std::string,
std::string > 
AliasToFile
 
typedef std::map< std::string,
Icon * > 
FileToIcon
 

Protected Member Functions

virtual void freeIcons ()
 

Detailed Description

Icon map

Author
Markus Fisch mf@ma.nosp@m.rkus.nosp@m.fisch.nosp@m..de

Constructor & Destructor Documentation

IconMap::~IconMap ( )
virtual

Free resources

References freeIcons().

Member Function Documentation

void IconMap::addClassAlias ( std::string  a,
std::string  n 
)
virtual

Add class alias

Parameters
a- class alias
n- icon name

Referenced by PieDock::Settings::load().

void IconMap::addNameAlias ( std::string  a,
std::string  n 
)
virtual

Add name alias

Parameters
a- alias name
n- icon name

Referenced by PieDock::Settings::load().

void IconMap::addTitleAlias ( std::string  a,
std::string  n 
)
virtual

Add title alias

Parameters
a- title alias
n- icon name

Referenced by PieDock::Settings::load().

Icon * IconMap::createIcon ( const ArgbSurface s,
const std::string  n,
Icon::Type  t 
)
virtual

Create icon and return it

Parameters
s- ARGB surface for icon
n- resource name of window
t- icon type

Referenced by getFillerIcon(), getIconByName(), getMissingIcon(), and PieDock::Menu::update().

void IconMap::freeIcons ( )
protectedvirtual

Free icons

Referenced by reset(), and ~IconMap().

Icon * IconMap::getFillerIcon ( )
virtual

Create and return a new filler icon

References createIcon(), and PieDock::Png::load().

Referenced by PieDock::Menu::update().

Icon * IconMap::getIcon ( std::string  t,
std::string  c,
std::string  n 
)
virtual

Return icon for given window properties

Parameters
t- window title
c- resource class
n- resource name

References getIconByClass(), getIconByName(), and getIconByTitle().

Referenced by PieDock::Menu::update().

Icon * IconMap::getIconByClass ( const std::string  c)
virtual

Return icon for a window by class

Parameters
c- resource class of window

References getIconByName().

Referenced by getIcon().

Icon * IconMap::getIconByName ( std::string  n)
virtual

Return icon for a window by name

Parameters
n- resource name of window

References createIcon(), and PieDock::Png::load().

Referenced by getIcon(), getIconByClass(), getIconByTitle(), PieDock::Settings::load(), and PieDock::Menu::update().

Icon * IconMap::getIconByTitle ( const std::string  t)
virtual

Return icon for a window by window title; this is by far the slowest method and probably prone to error too; use it only as a fallback ! Unfortunately, most Java applications have invalid resource names like "SWT" or the like; to identify those windows there's just one possibility: the window title

Parameters
t- window title (may contain wildcards)

References getIconByName(), and PieDock::WildcardCompare::match().

Referenced by getIcon().

Icon * IconMap::getMissingIcon ( const std::string  n)
virtual

Create and return a new icon for missing icons

Parameters
n- resource name of window for which there is no icon

References createIcon(), and PieDock::Png::load().

Referenced by PieDock::Menu::update().

void IconMap::reset ( )
virtual

Reset icon map

References freeIcons().

Referenced by PieDock::Settings::load().

void IconMap::saveIcon ( const ArgbSurface s,
const std::string  n 
) const
virtual

Save icon

Parameters
s- ARGB surface for icon
n- resource name of window

References PieDock::Png::save().

Referenced by PieDock::Menu::update().


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