/*------------------------------------------------------------------------------
 src/lib/djWidget/djIcon.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_ICON_H
#define DJ_ICON_H
#include <djBase.h>
#include <FL/Fl_Image.H>

namespace dj {

// Icon factory.
//
class IconFactory {
public:

  IconFactory();
  ~IconFactory();

  void add(const Str & name, Fl_Image *);
  
  // XXX Should return a const pointer.
  //
  Fl_Image * get(const Str & name) const;

private:

  typedef Map<Str, Fl_Image *> IconMap;
  IconMap _icons;
  Fl_Image _empty;
};

Fl_Image * icon(const Str & name);

}

#endif
