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

utoolkit.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/utoolkit.hpp 00008 begin : Mon Oct 29 2001 00009 $Id: utoolkit.hpp,v 1.15 2005/05/21 15:17:42 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 UTOOLKIT_HPP 00029 #define UTOOLKIT_HPP 00030 00031 #include "uobject.hpp" 00032 #include "ucontext.hpp" 00033 #include "uversioninfo.hpp" 00034 #include "uplugin.hpp" 00035 00036 #include "events/ukeysym.hpp" 00037 00038 #include "util/uinsets.hpp" 00039 #include "util/udimension.hpp" 00040 00041 #include <vector> 00042 00043 namespace ufo { 00044 00045 class UContext; 00046 class UPlugin; 00047 class ULookAndFeel; 00048 class UStyleManager; 00049 class UFontRenderer; 00050 00063 class UFO_EXPORT UToolkit : public UObject { 00064 UFO_DECLARE_ABSTRACT_CLASS(UToolkit) 00065 public: 00069 static UToolkit * getToolkit(); 00070 00074 static void setToolkit(UToolkit * toolkitA); 00075 00078 virtual void makeContextCurrent(UContext * contextA) = 0; 00079 virtual UContext * getCurrentContext() const = 0; 00080 00081 public: // administrative methods 00085 virtual UVersionInfo getVersionInfo() const = 0; 00086 00087 public: // window manager and user informations 00090 virtual UDimension getScreenSize() const = 0; 00094 virtual UInsets getScreenInsets() const = 0; 00097 virtual int getScreenDepth() const = 0; 00098 00099 00100 virtual std::string getUserName() const = 0; 00101 virtual std::string getRealName() const = 0; 00102 00103 virtual std::string getHomeDir() const = 0; 00104 virtual std::string getTmpDir() const = 0; 00105 00106 virtual std::string getPrgName() const = 0; 00107 virtual void setPrgName(const std::string & prgName) = 0; 00108 00109 00110 public: // Plugin methods 00113 virtual void loadPlugin(const std::string & fileName) = 0; 00115 virtual void loadPlugin(UPluginInfo plugin) = 0; 00116 00117 virtual void unloadPlugin(const std::string & pluginName) = 0; 00119 virtual void unloadPlugin(UPluginInfo plugin) = 0; 00120 00122 virtual std::vector<UPluginInfo> getPluginInfos() const = 0; 00123 00124 public: // font and laf methods 00125 virtual UVideoDriver * createVideoDriver() = 0; 00131 virtual ULookAndFeel * createLookAndFeel() = 0; 00132 virtual UStyleManager * getStyleManager() = 0; 00133 00137 virtual std::string getFontDir() const = 0; 00144 virtual UFontRenderer * createFontRenderer(const UFontInfo & fontInfo) = 0; 00151 virtual UFontInfo queryFont(const UFontInfo & fontInfo) = 0; 00155 virtual std::vector<UFontInfo> listFonts(const UFontInfo & fontInfo) = 0; 00158 virtual std::vector<UFontInfo> listFonts() = 0; 00159 00160 00161 public: // some useful and system dependent functions 00169 virtual void sleep(uint32_t millis) = 0; 00170 00173 virtual uint32_t getTicks() const = 0; 00174 00175 public: // UFO properties 00180 virtual std::string getProperty(const std::string & keyA) const = 0; 00184 virtual void putProperty(const std::string & keyA, const std::string & valueA) = 0; 00185 00186 protected: // Protected attributes 00188 static UToolkit * m_instance; 00189 }; 00190 00191 00192 // 00193 // inline implementation 00194 // 00195 00196 inline UToolkit * 00197 UToolkit::getToolkit() { 00198 return m_instance; 00199 } 00200 00201 inline void 00202 UToolkit::setToolkit(UToolkit * toolkitA) { 00203 m_instance = toolkitA; 00204 } 00205 00206 00207 } // namespace ufo 00208 00209 #endif // UTOOLKIT_HPP

The libUFO Project - written by Johannes Schmidt