#ifndef ROOT_TQClientFilter
#define ROOT_TQClientFilter
#include "GuiTypes.h"
#include "Rtypes.h"
#ifndef __CINT__
# include <qobject.h>
# if (QT_VERSION > 0x039999)
# include <QEvent>
# include <QMouseEvent>
# include <QList>
# else
# include <qptrqueue.h>
# include <qptrlist.h>
# include <qintdict.h>
# endif /* QT_VERSION */
# include <qapplication.h>
#else
class TQtClientWidget;
class QObject;
# if (QT_VERSION > 0x039999)
class QList<TQtClientWidget*>;
# else /* QT_VERSION */
class QPtrList<TQtClientWidget>;
# endif /* QT_VERSION */
#endif /* CINT */
#include "TQtClientWidget.h"
class TQtNextEventMessage;
class TQtEventQueue;
class TQtClientWidget;
class TQtPointerGrabber;
class TQtClientFilter : public QObject {
#ifndef __CINT__
Q_OBJECT
#endif
friend class TGQt;
friend class TQtClientWidget;
private:
void operator=(const TQtClientFilter &);
TQtClientFilter(const TQtClientFilter &);
protected:
TQtEventQueue *fRootEventQueue;
TQtNextEventMessage *fNotifyClient;
#ifndef __CINT__
#if (QT_VERSION > 0x039999)
QList<TQtClientWidget*> fButtonGrabList;
#else /* QT_VERSION */
QPtrList<TQtClientWidget> fButtonGrabList;
#endif /* QT_VERSION */
#endif
static TQtClientWidget *fgPointerGrabber;
static TQtClientWidget *fgButtonGrabber;
static TQtClientWidget *fgActiveGrabber;
TQtClientWidget *fKeyGrabber;
UInt_t fInputEventMask;
static UInt_t fgGrabPointerEventMask;
static Bool_t fgGrabPointerOwner;
static QCursor *fgGrabPointerCursor;
static TQtPointerGrabber *fgGrabber;
protected:
bool eventFilter( QObject *o, QEvent *e );
void AddKeyEvent( const QKeyEvent &event, TQtClientWidget *widget);
TQtEventQueue *Queue();
void SetKeyGrabber(TQtClientWidget *grabber) { fKeyGrabber = grabber;}
void UnSetKeyGrabber(TQtClientWidget *grabber) { if (fKeyGrabber == grabber) fKeyGrabber = 0; }
void RestoreLostGrabbing(Event_t &event);
static Bool_t IsGrabSelected(UInt_t selectEventMask);
static Bool_t SelectGrab(Event_t &event, UInt_t selectEventMask, QMouseEvent &me);
public:
TQtClientFilter():fRootEventQueue(0),fNotifyClient(0),fKeyGrabber(0){;}
virtual ~TQtClientFilter();
static TQtClientWidget *GetPointerGrabber();
static TQtClientWidget *GetButtonGrabber();
static void SetButtonGrabber(TQtClientWidget *grabber);
static void GrabPointer(TQtClientWidget *grabber, UInt_t evmask, Window_t confine,
QCursor *cursor, Bool_t grab = kTRUE,
Bool_t owner_events = kTRUE);
static TQtPointerGrabber *PointerGrabber() { return fgGrabber; }
public slots:
void AppendButtonGrab (TQtClientWidget *);
void RemoveButtonGrab (QObject *);
#ifndef Q_MOC_RUN
ClassDef(TQtClientFilter,0)
#endif
};
class QWidget;
class QCursor;
class TQtPointerGrabber {
private:
UInt_t fGrabPointerEventMask;
UInt_t fInputPointerEventMask;
Bool_t fGrabPointerOwner;
QCursor *fGrabPointerCursor;
TQtClientWidget *fPointerGrabber;
QWidget *fPointerConfine;
Bool_t fIsActive;
public:
TQtPointerGrabber(TQtClientWidget *grabber, UInt_t evGrabMask, UInt_t evInputMask,
QCursor *cursor, Bool_t grab = kTRUE,
Bool_t owner_events = kTRUE, QWidget *confine=0);
~TQtPointerGrabber();
void ActivateGrabbing(bool on=TRUE);
void DisactivateGrabbing(){ ActivateGrabbing(kFALSE); }
Bool_t IsGrabSelected(UInt_t selectEventMask) const;
Bool_t IsGrabbing(TQtClientWidget *grabbed) const { return (grabbed == fPointerGrabber); }
void SetGrabPointer( TQtClientWidget *grabber, UInt_t evGrabMask, UInt_t evInputMask
, QCursor *cursor, Bool_t grab = kTRUE
, Bool_t owner_events = kTRUE, QWidget *confine=0);
bool SelectGrab(Event_t &event, UInt_t selectEventMask,QMouseEvent &mouse);
};
inline TQtClientWidget *TQtClientFilter::GetPointerGrabber()
{ return fgPointerGrabber; }
inline TQtClientWidget *TQtClientFilter::GetButtonGrabber()
{ return fgButtonGrabber; }
inline void TQtClientFilter::SetButtonGrabber(TQtClientWidget *grabber)
{ fgButtonGrabber = grabber; }
inline void TQtClientFilter::AppendButtonGrab(TQtClientWidget *widget)
{ fButtonGrabList.append(widget);}
inline void TQtClientFilter::RemoveButtonGrab(QObject *widget)
{
TQtClientWidget *wid = (TQtClientWidget *)widget;
if ((fgButtonGrabber == wid) && fgGrabber) fgGrabber->DisactivateGrabbing();
#if (QT_VERSION >= 0x040000)
fButtonGrabList.removeAll(wid);
#else
fButtonGrabList.remove(wid);
#endif
}
inline TQtEventQueue *TQtClientFilter::Queue() {
TQtEventQueue *save = fRootEventQueue;
return save;
}
#endif
Last change: Fri Nov 28 17:01:25 2008
Last generated: 2008-11-28 17:01
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.