00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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:
00085
virtual UVersionInfo getVersionInfo()
const = 0;
00086
00087
public:
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:
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:
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:
00169
virtual void sleep(uint32_t millis) = 0;
00170
00173
virtual uint32_t getTicks()
const = 0;
00174
00175
public:
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:
00188 static UToolkit * m_instance;
00189 };
00190
00191
00192
00193
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 }
00208
00209
#endif // UTOOLKIT_HPP