// // FontHandler.hh for pekwm // Copyright (C) 2004-2009 Claes Nasten // // This program is licensed under the GNU GPL. // See the LICENSE file for more information. // #include "../config.h" #ifndef _FONT_HANDLER_HH_ #define _FONT_HANDLER_HH_ #include "PFont.hh" #include "Handler.hh" #include "ParseUtil.hh" #include #include #include //! @brief FontHandler, a caching and font type transparent font handler. class FontHandler { public: FontHandler(void); ~FontHandler(void); //! @brief Returns the FontHandler instance pointer. static inline FontHandler *instance(void) { return _instance; } PFont *getFont(const std::string &font); void returnFont(PFont *font); PFont::Color *getColor(const std::string &color); void returnColor(PFont::Color *color); private: void loadColor(const std::string &color, PFont::Color *font_color, bool fg); void freeColor(PFont::Color *font_color); private: std::list > _font_list; std::list > _color_list; std::map _map_type; std::map _map_justify; //! @brief Pointer to FontHandler instance, should only be one. static FontHandler *_instance; }; #endif // _FONT_HANDLER_HH_