#ifndef ROOT_TQtClientWidget
#define ROOT_TQtClientWidget
#ifndef __CINT__
#  include "qglobal.h"
#  if QT_VERSION < 0x40000
#     include <qframe.h>
#  else /* QT_VERSION */
#     include <QFrame>
#  endif /* QT_VERSION */
#  include <qcursor.h>
#else
  class QFrame;
  class QAccel;
  class QColor;
  class QPixmap;
#endif
  
#include "GuiTypes.h"
class QCursor;
class QCloseEvent;
class QPaintEvent;
class TQtClientGuard;
class TQtWidget;
class Q3Accel;
class TGWindow;
class TQtClientWidget: public QFrame {
#ifndef __CINT__
     Q_OBJECT
#endif
private:
         void  operator=(const TQtClientWidget&);
         TQtClientWidget(const TQtClientWidget&);
protected:
       UInt_t fGrabButtonMask;        
       UInt_t fGrabEventPointerMask;  
       UInt_t fGrabEventButtonMask;   
       UInt_t fSelectEventMask;       
       UInt_t fSaveSelectInputMask;   
       EMouseButton fButton;
#if (QT_VERSION >= 0x39999)
       Q3Accel  *fGrabbedKey;
#else /* QT_VERSION */
       QAccel  *fGrabbedKey;
#endif /* QT_VERSION */
       Bool_t   fPointerOwner;
       QCursor *fNormalPointerCursor;
       QCursor *fGrabPointerCursor;
       QCursor *fGrabButtonCursor;
       bool     fIsClosing;
       bool     fDeleteNotify;
       TQtClientGuard  *fGuard;
       TQtWidget       *fCanvasWidget;
       TGWindow *fMyRootWindow;  
       QColor   *fEraseColor;    
       QPixmap  *fErasePixmap;   
       friend class TQtClientGuard;
       friend class TGQt;
#ifndef __CINT__
      TQtClientWidget(TQtClientGuard *guard, QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
#else
      TQtClientWidget(TQtClientGuard *guard, QWidget* parent=0, const char* name=0, WFlags f=0);
#endif
      void SetCanvasWidget(TQtWidget *widget);
      virtual void paintEvent       ( QPaintEvent * );
public:
    enum {kRemove = -1, kTestKey = 0, kInsert = 1};
    virtual ~TQtClientWidget();
    virtual void closeEvent(QCloseEvent *ev);
    virtual void setEraseColor(const QColor &color);
    virtual void setErasePixmap (const QPixmap &pixmap);
    bool   DeleteNotify();
    TQtWidget *GetCanvasWidget() const;
    void   GrabEvent(Event_t &ev,bool own=TRUE);
#if (QT_VERSION >= 0x39999)
    Q3Accel *HasAccel() const ;
#else /* QT_VERSION */
    QAccel *HasAccel() const ;
#endif /* QT_VERSION */
    bool   IsClosing();
    bool   IsGrabbed       (Event_t &ev);
    bool   IsGrabPointerSelected(UInt_t evmask) const;
    bool   IsGrabButtonSelected (UInt_t evmask) const;
    TQtClientWidget *IsKeyGrabbed(const Event_t &ev);
    UInt_t IsEventSelected (UInt_t evmask) const;
    bool   IsGrabOwner()   { return fPointerOwner;}
    void   SetAttributeEventMask(UInt_t evmask);
    void   SetButtonMask   (UInt_t modifier=kAnyModifier,EMouseButton button=kAnyButton);
    void   SetClosing(bool flag=kTRUE);
    void   SetCursor();
    void   SetCursor(Cursor_t cursor);
    void   SetDeleteNotify(bool flag=true);
    void   SetButtonEventMask(UInt_t evmask,Cursor_t cursor=0);
    void   SelectInput       (UInt_t evmask);
    Bool_t SetKeyMask        (Int_t keycode = 0, UInt_t modifier=kAnyModifier,int insert=kInsert);
    void   UnSetButtonMask   (bool dtor=false);
    void   UnSetKeyMask(Int_t keycode = 0, UInt_t modifier=kAnyModifier);
    QCursor *GrabButtonCursor() const;
    QCursor *GrabPointerCursor() const;
    UInt_t ButtonMask  ()    const;
    UInt_t ButtonEventMask() const;
    UInt_t SelectEventMask() const;
    EMouseButton Button()    const;
    UInt_t PointerMask ()    const;
#ifndef __CINT__
protected slots:
      void Disconnect();
#endif
public slots:
    virtual void Accelerate(int id);
    virtual void polish();
#ifndef Q_MOC_RUN
    ClassDef(TQtClientWidget,0) 
#endif
};
inline bool TQtClientWidget::DeleteNotify(){return fDeleteNotify; }
inline TQtWidget *TQtClientWidget::GetCanvasWidget() const
{ return fCanvasWidget;}
 
#if QT_VERSION < 0x40000
inline QAccel *TQtClientWidget::HasAccel() const 
#else /* QT_VERSION */
inline Q3Accel *TQtClientWidget::HasAccel() const 
#endif /* QT_VERSION */
{  return fGrabbedKey; }
inline bool  TQtClientWidget::IsClosing(){ return fIsClosing; }
inline UInt_t TQtClientWidget::IsEventSelected (UInt_t evmask) const
{
   
   
   
   return  (evmask & fSelectEventMask); 
}
inline void TQtClientWidget::SetCursor()
{ 
   if (fNormalPointerCursor) setCursor(*fNormalPointerCursor);
}
inline void TQtClientWidget::SetCursor(Cursor_t cursor)
{
   
   fNormalPointerCursor = (QCursor *)cursor;
   SetCursor();
}
inline void  TQtClientWidget::SetClosing(bool flag) { fIsClosing = flag;}
inline void  TQtClientWidget::SetDeleteNotify(bool flag){fDeleteNotify = flag;}
inline void TQtClientWidget::SetAttributeEventMask(UInt_t evmask) { SelectInput (evmask);}
inline void TQtClientWidget::SetButtonEventMask(UInt_t evmask,Cursor_t cursor)
{ fGrabEventButtonMask = evmask; fGrabButtonCursor =(QCursor *) cursor; }
inline EMouseButton TQtClientWidget::Button() const { return fButton;          }
inline UInt_t TQtClientWidget::ButtonEventMask() const { return fGrabEventButtonMask;}
inline UInt_t TQtClientWidget::ButtonMask()  const { return fGrabButtonMask;   }
inline UInt_t TQtClientWidget::PointerMask() const { return fGrabEventPointerMask;}
inline UInt_t TQtClientWidget::SelectEventMask() const {return fSelectEventMask;}
inline QCursor *TQtClientWidget::GrabButtonCursor() const
{      return   fGrabButtonCursor;                                                }
inline QCursor *TQtClientWidget::GrabPointerCursor() const
{      return   fGrabPointerCursor;                                                }
inline bool TQtClientWidget::IsGrabPointerSelected(UInt_t evmask) const
{  return  evmask & PointerMask(); }
inline bool  TQtClientWidget::IsGrabButtonSelected (UInt_t evmask) const
{ return  evmask & ButtonEventMask(); }
#endif
Last change: Wed Jun 25 08:51:54 2008
Last generated: 2008-06-25 08:51
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.