- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

uabstracttoolkit.hpp

00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/uabstracttoolkit.hpp 00008 begin : Sat Jan 18 2003 00009 $Id: uabstracttoolkit.hpp,v 1.15 2005/10/18 16:39:24 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UABSTRACTTOOLKIT_HPP 00029 #define UABSTRACTTOOLKIT_HPP 00030 00031 #include "utoolkit.hpp" 00032 00033 #include <map> 00034 00035 namespace ufo { 00036 00037 class UProperties; 00038 00039 // no public API 00040 // used for map sorting 00041 bool operator<(const UPluginInfo & p1, const UPluginInfo & p2); 00042 00053 class UFO_EXPORT UAbstractToolkit : public UToolkit { 00054 UFO_DECLARE_ABSTRACT_CLASS(UAbstractToolkit) 00055 public: 00056 00059 UAbstractToolkit(UProperties * prop); 00060 virtual ~UAbstractToolkit(); 00061 00062 public: // Implements UToolkit 00063 virtual UVersionInfo getVersionInfo() const; 00064 00065 virtual std::string getUserName() const; 00066 virtual std::string getRealName() const; 00067 00068 virtual std::string getHomeDir() const; 00069 virtual std::string getTmpDir() const; 00070 00071 virtual std::string getPrgName() const; 00072 virtual void setPrgName(const std::string & prgName); 00073 00074 virtual std::string getFontDir() const; 00075 00076 virtual std::string getProperty(const std::string & keyA) const; 00077 virtual void putProperty(const std::string & keyA, const std::string & valueA); 00078 00079 public: // Plugin methods 00080 virtual void loadPlugin(const std::string & fileName); 00081 virtual void loadPlugin(UPluginInfo plugin); 00082 00083 virtual void unloadPlugin(const std::string & pluginName); 00084 virtual void unloadPlugin(UPluginInfo plugin); 00085 00086 virtual std::vector<UPluginInfo> getPluginInfos() const; 00087 00088 virtual UVideoDriver * createVideoDriver(); 00090 virtual ULookAndFeel * createLookAndFeel(); 00091 virtual UStyleManager * getStyleManager(); 00092 00093 virtual UFontRenderer * createFontRenderer(const UFontInfo & fontInfo); 00094 virtual UFontInfo queryFont(const UFontInfo & fontInfo); 00095 virtual std::vector<UFontInfo> listFonts(const UFontInfo & fontInfo); 00096 virtual std::vector<UFontInfo> listFonts(); 00097 00098 protected: // Protected methods 00100 virtual void initUFO(); 00101 virtual void deinitUFO(); 00103 virtual void initPlugins(); 00104 00105 private: // Private methods 00113 void initMissing(); 00114 UFontInfo privateQueryFont(const UFontInfo & fontInfo, std::string * renderer); 00115 00116 private: // Private attributes 00117 UProperties * m_properties; 00118 typedef std::list<std::pair<UPluginInfo, UFontPlugin*> > FontPluginCache; 00119 typedef std::list<std::pair<UPluginInfo, UVideoPlugin*> > VideoPluginCache; 00120 FontPluginCache m_fontPlugins; 00121 VideoPluginCache m_videoPlugins; 00122 }; 00123 00124 } // namespace ufo 00125 00126 #endif // UABSTRACTTOOLKIT_HPP

The libUFO Project - written by Johannes Schmidt