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 UCONTEXT_HPP
00029
#define UCONTEXT_HPP
00030
00031
#include "uobject.hpp"
00032
00033
#include "signals/usignal.hpp"
00034
00035
#include "util/urectangle.hpp"
00036
#include <list>
00037
00038
namespace ufo {
00039
00040
class UWidget;
00041
class URootPane;
00042
class UContextGroup;
00043
00044
class UUIManager;
00045
class UGraphics;
00046
class URepaintManager;
00047
class UImage;
00048
class UImageIO;
00049
class UInputMap;
00050
00051
class UEvent;
00052
00053
struct USystemInfo;
00054
00068 class UFO_EXPORT UContext :
public UObject {
00069 UFO_DECLARE_ABSTRACT_CLASS(UContext)
00070
public:
00071
enum {
00072 ShareNothing = 0,
00073 ShareGL = 1,
00074 ShareLAF = 3,
00075 ShareAll = ShareLAF
00076 };
00077
public:
00081
virtual UContextGroup * getContextGroup()
const = 0;
00082
00089
virtual UContext * getParent()
const = 0;
00090
00095
virtual UUIManager * getUIManager()
const = 0;
00096
00098
virtual UGraphics * getGraphics()
const = 0;
00099
00101
virtual URepaintManager * getRepaintManager()
const = 0;
00102
00110
virtual bool getSystemInfo(USystemInfo * info)
const = 0;
00111
00112
00124
00125
00129
virtual URootPane * getRootPane()
const = 0;
00130
00133
virtual void setRootPane(
URootPane * paneA) = 0;
00134
00138
virtual UImage * createImage(
UImageIO * imageIO) = 0;
00139
00143
virtual UImage * createImage(
const std::string & fileName) = 0;
00144
00146
virtual void lock() = 0;
00150
virtual void unlock() = 0;
00151
00152
00153
public:
00158
virtual void dispatchEvent(
UEvent * e) = 0;
00159
00165
virtual void setEventGrabber(
const USlot1<UEvent*> & slot) = 0;
00166
virtual void releaseEventGrabber() = 0;
00167
virtual USlot1<UEvent*> * getEventGrabber()
const = 0;
00168
00172
virtual void connectListener(
const USlot1<UEvent*> & slot) = 0;
00173
virtual void disconnectListener(
const USlot1<UEvent*> & slot) = 0;
00174
virtual std::list<USlot1<UEvent*> > getListeners()
const = 0;
00175
00176
virtual UInputMap * getInputMap() = 0;
00177
virtual void setInputMap(
UInputMap * newMap) = 0;
00178
public:
00180
virtual void setDeviceBounds(
const URectangle & rect) = 0;
00181
virtual URectangle getDeviceBounds()
const = 0;
00182
00183
00187
virtual void setContextBounds(
const URectangle & rect) = 0;
00188
virtual URectangle getContextBounds()
const = 0;
00189
00190
public:
00194
virtual void init() = 0;
00196
virtual void refresh() = 0;
00200
virtual void dispose() = 0;
00201
00202
public:
00206 USignal0 & sigRefresh();
00207
private:
00208 USignal0 m_sigRefresh;
00209 };
00210
00211
00212
00213
00214
00215
inline USignal0 &
00216 UContext::sigRefresh() {
00217
return m_sigRefresh;
00218 }
00219
00220 }
00221
00222
#endif // UCONTEXT_HPP