#ifndef ROOT_TGQt
#define ROOT_TGQt
#include "TQtRConfig.h"
#ifndef __CINT__
#include <vector>
#include <map>
#include <qobject.h>
#include <QMap>
#include <QColor>
#include <QCursor>
#include <QPainter>
#include <QRect>
#include <qnamespace.h>
#include <QtGui/QPixmap>
#include <QtCore/QEvent>
#include <QtCore/QVector>
#include <QtGui/QFontDatabase>
#include "TQtClientGuard.h"
#else
class QObject;
class QEvent;
#endif /* CINT */
class QPainter;
class QPen;
class QMarker;
class QPaintDevice;
class QTextCodec;
class QPoint;
class QString;
class QSize;
class QColor;
#include "TVirtualX.h"
#include "TQtEmitter.h"
class TQtMarker;
class TQtPen;
class TQtSwitch;
class TQtBrush;
class TQtCommand;
class TFileHandler;
class TQtApplication;
class TQtClientFilter;
class TQtEventQueue;
class TQtPadFont;
class TQtPen;
class TQtPainter;
class TQtFeedBackWidget;
class TQtTextProxy {
private:
TQtTextProxy(const TQtTextProxy&);
void operator=(const TQtTextProxy&);
protected:
TQtTextProxy(){;}
public:
virtual ~TQtTextProxy(){;}
virtual void clear() = 0;
bool setContent(const char *text, QString *errorMsg = 0,
int *errorLine = 0, int *errorColumn = 0);
virtual bool setContent(const QString &text, QString *errorMsg = 0,
int *errorLine = 0, int *errorColumn = 0) = 0;
virtual bool setMmlContent(const QString &text, QString *errorMsg = 0,
int *errorLine = 0, int *errorColumn = 0) = 0;
virtual void paint(QPainter *p,unsigned int x, unsigned int y) const = 0;
virtual unsigned int width() const = 0;
virtual unsigned int height() const = 0;
virtual void setFont(Font_t fontnumber) = 0;
virtual int baseFontPointSize() const = 0;
virtual void setBaseFontPointSize(int size) = 0;
virtual void setForegroundColor(const QColor &) = 0;
virtual bool isMine() const { return false;};
virtual TQtTextProxy *Clone() = 0;
};
inline bool TQtTextProxy::setContent(const char *text, QString *errorMsg,
int *errorLine, int *errorColumn )
{ return setContent(QString(text),errorMsg, errorLine, errorColumn); }
class TGQt : public TVirtualX {
#ifndef __CINT__
friend class TQtObject;
friend class TQtWindowsObject;
friend class TQtPixmapObject;
friend class TPadOpenGLView;
friend class TQtWidget;
friend class TQtClientWidget;
friend class TQtImage;
friend class TQtClientGuard;
friend class TQtClientFilter;
friend class TQtSynchPainting;
friend class TQtToggleFeedBack;
friend class TQtColorSelect;
friend class TQt16ColorSelector;
friend class TQtPen;
friend class TQtBrush;
friend class TQtPainter;
friend class TQtTextProxy;
protected:
enum DEFWINDOWID { kDefault=1 };
QPaintDevice *fSelectedWindow;
QPaintDevice *fPrevWindow;
Int_t fDisplayOpened;
TQtPainter *fQPainter;
TQtEmitter fEmitter;
static TVirtualX *fgTQt;
void *fhEvent;
QVector<QCursor *> fCursors;
ECursor fCursor;
Style_t fMarkerStyle;
Int_t fTextAlignH;
Int_t fTextAlignV;
Float_t fCharacterUpX;
Float_t fCharacterUpY;
Int_t fTextFontModified;
Float_t fTextMagnitude;
TQtBrush *fQBrush;
TQtPen *fQPen;
TQtMarker *fQtMarker;
TQtPadFont *fQFont;
QPainter::CompositionMode fDrawMode;
typedef QMap<QPaintDevice *,QRect> TQTCLIPMAP;
TQTCLIPMAP fClipMap;
QMap<Color_t,QColor*> fPallete;
TQtClientFilter *fQClientFilter;
TQtEventQueue *fQClientFilterBuffer;
TQtClientGuard fQClientGuard;
TQtPixmapGuard fQPixmapGuard;
typedef std::map<ULong_t, QColor * > COLORMAP;
COLORMAP fColorMap;
TQtClientWidget *fPointerGrabber;
QTextCodec *fCodec;
QString fFontTextCode;
const char *fSymbolFontFamily;
Int_t fQtEventHasBeenProcessed;
Bool_t fFeedBackMode;
TQtFeedBackWidget *fFeedBackWidget;
Bool_t fBlockRGB;
Bool_t fUseTTF;
static TQtTextProxy *fgTextProxy;
Int_t CreatROOTThread();
void DeleteSelectedObj();
static QRect GetQRect(QPaintDevice &dev);
int UpdateColor(int cindex);
QPaintDevice *GetDoubleBuffer(QPaintDevice *dev);
#endif
static Int_t RegisterWid(QPaintDevice *wid);
static Int_t UnRegisterWid(QPaintDevice *wid);
static Bool_t IsRegistered(QPaintDevice *wid);
private:
TGQt& operator=(const TGQt&);
public:
TGQt();
TGQt(const TGQt &vx): TVirtualX(vx) { MayNotUse("TGQt(const TGQt &)"); }
TGQt(const char *name, const char *title);
virtual ~TGQt();
#include "TVirtualX.interface.h"
#ifndef __CINT__
virtual QPaintDevice *GetSelectedWindow(){ return fSelectedWindow; }
virtual void SetFillStyleIndex( Int_t style, Int_t fasi);
virtual void SetMarkerType( Int_t type, Int_t n, TPoint *xy );
virtual void SetTitle(const char *title);
virtual void CopyPixmap(const QPixmap &p, Int_t px1, Int_t py1);
virtual void SetTextDecoder(const char * ){;}
virtual const QTextCodec *GetTextDecoder();
#endif
virtual void PutByte(Byte_t b);
virtual Bool_t IsHandleValid(Window_t id);
static TQtApplication *CreateQtApplicationImp();
static Int_t iwid(QPaintDevice *wid);
static QPaintDevice *iwid(Int_t wid);
static QPaintDevice *iwid(Window_t wid);
#ifndef __CINT__
#if ROOT_VERSION_CODE < ROOT_VERSION(5,13,0)
static QPixmap *MakeIcon(Int_t indx);
#endif
static TVirtualX *GetVirtualX();
static QWidget *winid(Window_t id);
static QWidget *wid(Window_t id);
static Window_t wid(TQtClientWidget *widget);
static Window_t rootwid(QPaintDevice *dev);
static void PrintEvent(Event_t &);
static QString SetFileName(const QString &fileName);
static QString GetNewFileName(const QString &fileNamePrototype);
static TQtTextProxy *TextProxy();
static void SetTextProxy(TQtTextProxy *proxy);
void SetQClientFilter(TQtClientFilter *filter) {fQClientFilter = filter;}
TQtClientFilter *QClientFilter() const {return fQClientFilter;}
QColor QtColor(ULong_t pixel);
void SendDestroyEvent(TQtClientWidget *) const;
TQtEmitter *Emitter(){ return &fEmitter;}
#endif
virtual void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b, Float_t a);
virtual void SetAlpha(Int_t cindex, Float_t a);
virtual void GetRGBA(Int_t cindex, Float_t &r, Float_t &g, Float_t &b, Float_t &a);
virtual Float_t GetAlpha(Int_t cindex);
virtual const QColor& ColorIndex(Color_t indx) const;
virtual Int_t LoadQt(const char *shareLibFileName);
static void PostQtEvent(QObject *receiver, QEvent *event);
virtual Int_t processQtEvents(Int_t maxtime=300);
private:
static int fgCoinFlag;
static int fgCoinLoaded;
public:
static int CoinFlag();
static void SetCoinFlag(int flag);
static void SetCoinLoaded();
static Int_t IsCoinLoaded();
#ifndef __CINT__
static QString RootFileFormat(const char *selector);
static QString RootFileFormat(const QString &selector);
static QString QtFileFormat(const char *selector);
static QString QtFileFormat(const QString &selector);
#endif
#ifndef Q_MOC_RUN
ClassDef(TGQt,0)
#endif
};
R__EXTERN TGQt *gQt;
#endif