ROOT logo
// @(#)root/qt:$Id: TGQt.cxx 36275 2010-10-11 08:05:21Z brun $
// Author: Valeri Fine   21/01/2002
/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * Copyright (C) 2002 by Valeri Fine.                                    *
 * All rights reserved.                                                  *
 *                                                                      *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGQt                                                                 //
//                                                                      //
// This class is the basic interface to the Qt graphics system. It is   //
// an implementation of the abstract TVirtualX class.                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#if defined(HAVE_CONFIG) || defined (R__HAVE_CONFIG)
# include "config.h"
#endif
#ifdef R__QTWIN32
#include <process.h>
#endif

#include <assert.h>

//  Qt include files

#include <QApplication>
#include <QWidget>
#include <QPolygon>
#include <QEvent>
#include <QImageWriter>
#include <QVector>
#include <QStack>
#include <QFrame>
#include <QPicture>
#include <QDebug>

#include <qpixmap.h>
#include <qcursor.h>
#include <qdesktopwidget.h>
#include <qimage.h>
#include <qfontmetrics.h>
#include <qdialog.h>
#include <qlineedit.h>
#include <qfileinfo.h>
#include <qtextcodec.h>
#include <qdir.h>

#include "TROOT.h"
#include "TMath.h"
#include "TColor.h"
#include "TEnv.h"
#include "TQtPen.h"

#include "TQtApplication.h"
#include "TQtWidget.h"
#include "TGQt.h"
#include "TQtBrush.h"
#include "TQtClientFilter.h"
#include "TQtEventQueue.h"
#include "TQtSymbolCodec.h"
#include "TQtLock.h"
#include "TQtPadFont.h"
#include "TStyle.h"
#include "TObjString.h"
#include "TObjArray.h"

#include "TSystem.h"
#ifdef R__QTWIN32
#  include "TWinNTSystem.h"
#  include "Win32Constants.h"
#  include <Winuser.h>
#else
# ifdef R__QTX11
#  include <X11/Xlib.h>
# endif
#endif

#include "TSysEvtHandler.h"
#include "TQtMarker.h"

#include "TImage.h"
#include "TError.h"

TGQt *gQt=0;
TVirtualX *TGQt::fgTQt = 0; // to remember the pointer foolishing ROOT PluginManager later.
TQtTextProxy  *TGQt::fgTextProxy = 0; // The pointer to the custom text proxy;
class TQtTextCloneProxy {
private:
   TQtTextProxy *fProxy;
   void *operator new(size_t);
   TQtTextCloneProxy(const TQtTextCloneProxy&);
   void operator=(const TQtTextCloneProxy&);
public:
   TQtTextCloneProxy()  : fProxy(0) 
   {
      if ( TGQt::TextProxy())
         fProxy = TGQt::TextProxy()->Clone();
   }
   inline ~TQtTextCloneProxy() { delete fProxy; }
   inline TQtTextProxy *operator->() { return fProxy;}
};

#define NoOperation (QPaintDevice *)(-1)

// static const int kDefault=2;
//__________________________________________________________________
static QWidget *IsWidget(QPaintDevice *d)
{ return  dynamic_cast<QWidget *>(d);   }

//__________________________________________________________________
static QPixmap *IsPixmap(QPaintDevice *d)
{ return dynamic_cast<QPixmap *>(d); }
//__________________________________________________________________
QString TGQt::SetFileName(const QString &fileName)
{
   // Set the file pattern
   QFileInfo  fi(fileName);
   QString saveFileMoviePattern =
            fi.path()+"/" + fi.completeBaseName()+ "_%04d" + "." + fi.suffix();
   return saveFileMoviePattern;
}
//__________________________________________________________________
QString TGQt::GetNewFileName(const QString &fileNamePrototype)
{
   // Find the filename for the given "fileNamePrototype"
   TString flN = fileNamePrototype.toStdString().c_str();
   gSystem->ExpandPathName(flN);
   QString fileName = (const char *)flN;

   Int_t counter = 0;
   QString formatPattern = SetFileName(fileName);
   while (gSystem->AccessPathName(fileName.toStdString().c_str())==0) {
      fileName = QString().sprintf(formatPattern.toStdString().c_str(),counter++);
   }
   return  fileName;
}
//______________________________________________________________________________
//
//  custom TQtPainter
//______________________________________________________________________________
class TQtPainter : public QPainter {
private:
    TGQt *fVirtualX;
protected:
   inline void UpdateBrush() { setBrush(*fVirtualX->fQBrush); }
   inline void UpdatePen()   { setPen(*fVirtualX->fQPen);     }
   inline void UpdateFont()  { setFont(*fVirtualX->fQFont);
                               fVirtualX->fTextFontModified = 0;
                             }
public:
   enum  { kNone        = 0,
           kUseFeedBack = 1,
           kUpdateFont  = 2,
           kUpdateBrush = 4,
           kUpdatePen   = 8
   };
   TQtPainter() : QPainter (), fVirtualX(0) {}
   TQtPainter(QPaintDevice * dev) : QPainter ( dev ), fVirtualX(0) {}
   TQtPainter( TGQt *dev, unsigned int useFeedBack=kUpdateBrush | kUpdatePen ) : fVirtualX(0) 
   {  begin(dev,useFeedBack);                                       }
   ~TQtPainter () { fVirtualX->fQPainter = 0; }
   bool begin ( TGQt *dev, unsigned int useFeedBack);
};
//______________________________________________________________________________
//
//   class TQtFeedBackWidget to back the TCanvas FeedBack mode
//______________________________________________________________________________
class TQtFeedBackWidget : public QFrame {
   QPixmap   *fPixBuffer;
   QPixmap   *fGrabBuffer;
   TQtWidget *fParentWidget;
protected:
   virtual void hideEvent (QHideEvent *ev) {
      // hide the feedback widget and remove the buffer
      delete fPixBuffer;  fPixBuffer  = 0;  
      delete fGrabBuffer; fGrabBuffer = 0;
      QFrame::hideEvent(ev);
      if (fParentWidget) {
         fParentWidget->SetIgnoreLeaveEnter(0);         
         SetParent(0);  // reparent // it is dangerous thing to do inside of the event processing
      }
   }
   virtual void paintEvent(QPaintEvent *ev) {
      if (fPixBuffer) {
         QRect rc = ev->rect();
         {
            QPainter p(this);
            p.setClipRect(rc);
            p.drawPixmap(0,0,*fPixBuffer);
         }
         ClearBuffer();
      } else if (fGrabBuffer) {
         QRect rc = ev->rect(); 
         QPainter p(this);
         p.setClipRect(rc);
         p.drawPixmap(rc,*fGrabBuffer);
      }
      QFrame::paintEvent(ev);
   }
public:
   TQtFeedBackWidget(QWidget *mother=0, Qt::WindowFlags f=0)  : QFrame(mother,f)
      ,fPixBuffer(0),fGrabBuffer(0),fParentWidget(0)
   {
      // Create the feedback widget
      setAttribute(Qt::WA_NoSystemBackground); 
      setEnabled(false);
      setBackgroundRole(QPalette::Window);
      setAutoFillBackground(false);
      QPalette  p = palette();
      p.setBrush(QPalette::Window, Qt::transparent);
      setPalette(p);
      setMouseTracking(true);
   }
   virtual ~TQtFeedBackWidget() 
   {
      fParentWidget = 0;
      delete fPixBuffer; fPixBuffer   = 0;
      delete fGrabBuffer; fGrabBuffer = 0;
   }
   void SetParent(TQtWidget *w) {
      setParent(fParentWidget = w);
   }
   void Hide() {
      if (fParentWidget) {
         fParentWidget->SetIgnoreLeaveEnter(0);         
         SetParent(0);  // reparent
      }
   }
   void Show() {
      // Protect (Qt >= 4.5.x) TCanvas  against of 
      // the confusing mouseMoveEvent
      if (fParentWidget) fParentWidget->SetIgnoreLeaveEnter(2);
      QFrame::show();
      if (fParentWidget) fParentWidget->SetIgnoreLeaveEnter();
   }
   QPaintDevice *PixBuffer() {
      // Create the feedback buffer if needed
      if (fParentWidget ) {
         // resize the feedback
         QSize canvasSize = fParentWidget->size();
         setGeometry(QRect(QPoint(0,0),canvasSize));
         if ( !fPixBuffer  || (fPixBuffer->size() != canvasSize) ) {
            delete fPixBuffer;
            fPixBuffer = new QPixmap(canvasSize);
            ClearBuffer();
         }
      }
      return  fPixBuffer;
   }
    QPaintDevice *GrabBuffer(QSize &s) { 
      // Create the feedback buffer to grab the parent TPad image
      if (fParentWidget ) {
         // resize the feedback
          if ( !fPixBuffer  || (fPixBuffer->size() != s) ) {
            delete fPixBuffer;
            fPixBuffer = new QPixmap(s);
            ClearBuffer();
         }
      }
      return  fPixBuffer;
   }
   void ClearBuffer() {
      // Fill the feedback buffer with the transparent background
      fPixBuffer->fill(Qt::transparent);
   }
   void SetGeometry(int xp,int yp, int w, int h, TQtWidget *src=0)
   {
       // Set the feedback widget position and geometry
       if (isHidden() && src ) {
          // grab the parent window and move the feedback 
          delete fGrabBuffer; fGrabBuffer = 0;
          QPixmap *canvas = src->GetOffScreenBuffer();
          if (canvas && w > 4 &&  h > 4 ) {
             fGrabBuffer = new QPixmap(canvas->copy(xp,yp,w,h));
          }
       }
       setGeometry(xp,yp,w,h);
   }
};

//______________________________________________________________________________
//
//   class TQtFeedBackWidget to back the TCanvas FeedBack mode
//______________________________________________________________________________

class TQtToggleFeedBack {
   TGQt *fGQt;
   TQtPainter  fFeedBackPainter;

public:
   TQtToggleFeedBack(TGQt *gqt) : fGQt(gqt)
   {
      // activate temporary TQtFeedBackWidget widget buffer
      if (fGQt->fFeedBackMode && fGQt->fFeedBackWidget->isHidden()) {
         fGQt->fFeedBackWidget->Show();
      }
   }
   ~TQtToggleFeedBack()
   {
      // Update the "feedback" widget
     if (fFeedBackPainter.isActive() ) fFeedBackPainter.end();
     if (fGQt->fFeedBackMode && fGQt->fFeedBackWidget) 
     {   fGQt->fFeedBackWidget->update();                   }
   }
   TQtPainter &painter() {
      // activate return  the "feedback" painter
      if (!fFeedBackPainter.isActive()) {
         fFeedBackPainter.begin(fGQt, TQtPainter::kUseFeedBack 
                                    | TQtPainter::kUpdatePen 
                                    | TQtPainter::kUpdateBrush);
         if (fGQt->fFeedBackMode) {
            fFeedBackPainter.setPen(QColor(128,128,128,128));// Qt::white);// darkGray);
        }
     }
     return fFeedBackPainter; 
   }
};

//______________________________________________________________________________
//
//  custom TQtPainter
//______________________________________________________________________________
inline bool TQtPainter::begin ( TGQt *dev, unsigned int useFeedBack)
{
  // Activate return  the "feedback" painter 
  bool res = false;
  if (dev && (dev->fSelectedWindow != NoOperation)) {
     fVirtualX = dev;
     QPaintDevice *src= 0;
     if ( (useFeedBack & kUseFeedBack) && dev->fFeedBackMode
                     && dev->fFeedBackWidget
                     && dev->fFeedBackWidget) 
     { src = dev->fFeedBackWidget->PixBuffer(); }
     else {
        src = dev->fSelectedWindow;
        if ( src->devType() ==  QInternal::Widget)
        {
           TQtWidget *theWidget =  (TQtWidget *)src;
          // Substitute the widget with its internal buffer
           src = theWidget->SetBuffer().Buffer();
        }
     }
     if (!(res= QPainter::begin(src)) ) {
        Error("TGQt::Begin()","Can not create Qt painter for win=0x%lx dev=0x%lx\n",(Long_t)src,(Long_t)dev);
        assert(0);
     } else {
        dev->fQPainter = (TQtPainter*)-1;
        UpdatePen();
        UpdateBrush();
        UpdateFont();
        TGQt::TQTCLIPMAP::iterator it= (dev->fClipMap).find(src);
        QRect clipRect;
        if (it != (dev->fClipMap).end())  {
           clipRect = it.value();
           setClipRect(clipRect);
           setClipping(TRUE);
        }
        if (src->devType() ==  QInternal::Image )
                 setCompositionMode(dev->fDrawMode);
     }
  }
  return res;
}


//----- Terminal Input file handler --------------------------------------------
//______________________________________________________________________________
class TQtEventInputHandler : public TTimer {
protected: // singleton
   TQtEventInputHandler() : TTimer(340) {  }
   static TQtEventInputHandler *gfQtEventInputHandler;
public:

   static TQtEventInputHandler *Instance() {
     if (!gfQtEventInputHandler)
       gfQtEventInputHandler =  new  TQtEventInputHandler();
       gfQtEventInputHandler->Start(240);
       return gfQtEventInputHandler;
   }
   Bool_t Notify()     {
      Timeout();       // emit Timeout() signal
      Bool_t ret = gQt->processQtEvents();
      Start(240);
      Reset();
      return  ret;
   }
   Bool_t ReadNotify() { return Notify(); }
};

TQtEventInputHandler *TQtEventInputHandler::gfQtEventInputHandler = 0;
//______________________________________________________________________________
//  static methods:
//______________________________________________________________________________
//______________________________________________________________________________
//  static methods:
// kNone    =  no window
// kDefault =  means default desktopwindow
//  else the pointer to the QPaintDevice

class TQWidgetCollection {
 private:
   QStack<int>             fFreeWindowsIdStack;
   QVector<QPaintDevice *> fWidgetCollection;
   Int_t                    fIDMax;       //  current max id
   Int_t                    fIDTotalMax;  // life-time max id
protected:
   //______________________________________________________________________________
   inline  Int_t SetMaxId(Int_t newId)
   {
      fIDMax =  newId;
      if (newId>fIDTotalMax) {
         fIDTotalMax  = newId;
         fWidgetCollection.resize(fIDTotalMax+1);
      }
      return fIDMax;
   }

 public:
   //______________________________________________________________________________
   TQWidgetCollection () : fIDMax(-1), fIDTotalMax(-1)
   {
       // mark the position before kNone and between kNone and kDefault
       // as "free position" if any
       int kDefault = 1;
       assert(!kNone);
       SetMaxId (kDefault);
       fWidgetCollection[kNone]    = (QPaintDevice*)0;
       fWidgetCollection[kDefault] = (QPaintDevice *)QApplication::desktop();
   }

   //______________________________________________________________________________
   inline Int_t GetFreeId(QPaintDevice *device) {

      Int_t Id = 0;
      if (!fFreeWindowsIdStack.isEmpty() ) {
         Id = fFreeWindowsIdStack.pop();
         if (Id > fIDMax ) SetMaxId ( Id );
      } else {
         Id = fWidgetCollection.count();
         assert(fIDMax <= Id  );
         SetMaxId ( Id );
      }
      fWidgetCollection[Id] = device;
      // fprintf(stderr," add %p as %d max Id = %d \n", device, Id,fIDMax);
      return Id;
   }
   //______________________________________________________________________________
   inline Int_t RemoveByPointer(QPaintDevice *device)
   {
      // method to provide the ROOT "cast" from (QPaintDevice*) to ROOT windows "id"
      Int_t intWid = kNone;             // TGQt::iwid(device);
      if ((ULong_t) device != (ULong_t) -1) {
          intWid = find( device);
          if ( intWid != -1 && 
             fWidgetCollection[intWid]) {
             fWidgetCollection[intWid] = (QPaintDevice *)(-1);
             fFreeWindowsIdStack.push(intWid);
             if (fIDMax == intWid) SetMaxId(--fIDMax);
          } else {
             intWid = kNone;
          }
      }
      return intWid;
   }

   //______________________________________________________________________________
   inline const QPaintDevice *DeleteById(Int_t Id)
   {
     QPaintDevice *device = fWidgetCollection[Id];
     if (device) {
        delete device;
        fWidgetCollection[Id] = (QPaintDevice *)(-1);
        fFreeWindowsIdStack.push(Id);
        if (fIDMax == Id) SetMaxId(--fIDMax);
     }
     //return device; this was a huge bug
     return 0;
   }
   //______________________________________________________________________________
   inline const QPaintDevice *ReplaceById(Int_t Id, QPaintDevice *newDev)
   {
      if (newDev) {
        // delete the old definition
        delete fWidgetCollection[Id];
        // add the new one instead
        fWidgetCollection[Id] = newDev;
      } else {
         DeleteById(Id);
      }
      return newDev;
   }

   //______________________________________________________________________________
   inline uint count() const { return fWidgetCollection.count();}
   //______________________________________________________________________________
   inline uint MaxId() const { return fIDMax;}
   //______________________________________________________________________________
   inline uint MaxTotalId() const { return fIDTotalMax;}
   //______________________________________________________________________________
   inline int find(const QPaintDevice *device, uint i=0) const
   { 
      return fWidgetCollection.indexOf((QPaintDevice*)device,i); 
   }
   //______________________________________________________________________________
   inline QPaintDevice *operator[](int i) const {return fWidgetCollection[i];}
};
TQWidgetCollection *fWidgetArray = 0;
//______________________________________________________________________________
QPaintDevice *TGQt::iwid(Window_t wd)
{
   // Convert ROOT Widget Id to the Qt QPaintDevice pointer
   QPaintDevice *topDevice = 0;
   if ( wd != kNone )   {
       topDevice = (wd == kDefault) ?
              (QPaintDevice *)QApplication::desktop()
             :
              (QPaintDevice*)wd;
   }
   return topDevice;
}

//______________________________________________________________________________
Int_t         TGQt::iwid(QPaintDevice *wd)
{
   // method to provide the ROOT "cast" from (QPaintDevice*) to ROOT windows "id"
   Int_t intWid = kNone;
       // look up the widget
   if ((ULong_t) wd == (ULong_t) -1) intWid = -1;
   else {
      intWid = fWidgetArray->find(wd);
      assert(intWid != -1);
      // if (intWid == -1) intWid = Int_t(wd);
   }
   return intWid;
}

//______________________________________________________________________________
QPaintDevice *TGQt::iwid(Int_t wd)
{
   // method to restore (cast) the QPaintDevice object pointer from  ROOT windows "id"
   QPaintDevice *topDevice = 0;
   if (0 <= wd && wd <= int(fWidgetArray->MaxId()) )
     topDevice = (*fWidgetArray)[wd];
     if (topDevice == (QPaintDevice *)(-1) ) topDevice = 0;
   else {
     assert(wd <= Int_t(fWidgetArray->MaxTotalId()));
     // this is allowed from the embedded TCanvas dtor only.
     //  at this point "wd" may have been destroyed
     //-- vf topDevice = (QPaintDevice *)wd;
   }
   return topDevice;
}

//______________________________________________________________________________
QWidget      *TGQt::winid(Window_t id)
{
   // returns the top level QWidget for the ROOT widget
   return (id != kNone)? TGQt::wid(id)->topLevelWidget():0;
}

//______________________________________________________________________________
Window_t    TGQt::wid(TQtClientWidget *widget)
{
   return rootwid(widget);
}
//______________________________________________________________________________
Window_t    TGQt::rootwid(QPaintDevice *dev)
{
   return Window_t(dev);
}
//______________________________________________________________________________
QWidget      *TGQt::wid(Window_t id)
{
   // method to restore (dynamic cast) the QWidget object pointer (if any) from  ROOT windows "id"
   QPaintDevice *dev = 0;
   if (id == (Window_t)kNone || id == (Window_t)(-1) ) return (QWidget *)dev;
   if ( id <= fWidgetArray->MaxId() )
      dev = (*fWidgetArray)[id];
   else
      dev = (QPaintDevice *)id;


#if 0
     if ( dev->devType() != QInternal::Widget) {
        fprintf(stderr," %s %i type=%d QInternal::Widget = %d id =%x id = %d\n", "TGQt::wid", __LINE__
           , dev->devType()
           , QInternal::Widget, id, id );
//           , (const char *)dev->name(), (const char *)dev->className(), QInternal::Widget);
   }
#endif
   assert(dev->devType() == QInternal::Widget);
   return (QWidget *)dev;
}

//______________________________________________________________________________
void TGQt::PrintEvent(Event_t &ev)
{
   // Dump trhe ROOT Event_t structure to debug the code

   //EGEventType fType;              // of event (see EGEventTypes)
   //Window_t    fWindow;            // window reported event is relative to
   //Time_t      fTime;              // time event event occured in ms
   //Int_t       fX, fY;             // pointer x, y coordinates in event window
   //Int_t       fXRoot, fYRoot;     // coordinates relative to root
   //UInt_t      fCode;              // key or button code
   //UInt_t      fState;             // key or button mask
   //UInt_t      fWidth, fHeight;    // width and height of exposed area
   //Int_t       fCount;             // if non-zero, at least this many more exposes
   //Bool_t      fSendEvent;         // true if event came from SendEvent
   //Handle_t    fHandle;            // general resource handle (used for atoms or windows)
   //Int_t       fFormat;            // Next fields only used by kClientMessageEvent
   //Long_t      fUser[5];           // 5 longs can be used by client message events
   //                                // NOTE: only [0], [1] and [2] may be used.
   //                                // [1] and [2] may contain >32 bit quantities
   //                                // (i.e. pointers on 64 bit machines)
   qDebug() << "----- Window "<<  TGQt::wid(ev.fWindow) << TGQt::wid(ev.fWindow) << " " << TGQt::wid(ev.fWindow)-> objectName();
   fprintf(stderr,"event type =  %x, key or button code %d \n", ev.fType, ev.fCode);
   fprintf(stderr,"fX, fY, fXRoot, fYRoot = %d %d  :: %d %d\n", ev.fX, ev.fY,ev.fXRoot, ev.fYRoot);
}

int TGQt::fgCoinFlag = 0; // no current coin viewer;
int TGQt::fgCoinLoaded = 0; // coint viewer DLL has not been loaded

//______________________________________________________________________________
int TGQt::CoinFlag()
{
  // return the Coin/QGL viewer flag safely
   TQtLock lock;
   int ret = fgCoinFlag;
   return ret;
}

//______________________________________________________________________________
void TGQt::SetCoinFlag(int flag)
{
  // Set the Coin/QGL viewer flag safely
   TQtLock lock;
   fgCoinFlag=flag;
}

//______________________________________________________________________________
void TGQt::SetCoinLoaded() {  fgCoinLoaded = 1; }

//______________________________________________________________________________
Int_t TGQt::IsCoinLoaded(){ return fgCoinLoaded;}

#if ROOT_VERSION_CODE < ROOT_VERSION(5,13,0)
//______________________________________________________________________________
QPixmap *TGQt::MakeIcon(Int_t i)
{
//  Create the Qt QPixamp from the WIN32 system icon (for WIN32 only)
   QPixmap *tempIcon = NULL;
   if (i) { /* just to suspend the warning under UNIX */ }
#ifdef R__QTWIN32
   HICON largeIcon[1];
   HICON smallIcon[1];
   HICON icon = ((TWinNTSystem *)gSystem)->GetNormalIcon(i);
#if 0
   int numIcons = ::ExtractIconEx(
    "c:\winnt\explorer.exe",
    0,
    largeIcon,
    smallIcon,
    1);
   if (numIcons > 0)
   {
#endif
   tempIcon =new QPixmap (GetSystemMetrics(SM_CXSMICON),
                          GetSystemMetrics(SM_CYSMICON));
   HDC dc = tempIcon->handle();
   DrawIcon (dc, 0, 0, icon);
#else
# ifdef ROOTICONPATH
   gSystem->ExpandPathName(ROOTICONPATH);
# else
   gSystem->ExpandPathName("$ROOTSYS/icons/");
//   tempIcon =new QPixmap (16,16),
# endif
#endif
   return tempIcon;
}
#endif


ClassImp(TGQt)

//____________________________________________________
//
//   Some static methods
//______________________________________________________________________________
QString TGQt::RootFileFormat(const char *selector)
{  return RootFileFormat(QString(selector)); }

//______________________________________________________________________________
QString TGQt::RootFileFormat(const QString &selector)
{
   // Define whether the input string contains any pattern
   // that matches the ROOT image formats
   // those Qt library can not provide
   QString saveType;
   QString defExtension[] = {"cpp","cxx","eps","svg","root","pdf","ps","xml"
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,13,0)
                             ,"gif"
#endif
                             ,"C"};
   UInt_t nExt = sizeof(defExtension)/sizeof(const char *);
    UInt_t i = 0;
   for (i=0; i < nExt; i++) {
      if (selector.contains(defExtension[i], Qt::CaseSensitive)) {
         saveType = defExtension[i];
         break;
      }
   }
   if (saveType.contains("C",Qt::CaseInsensitive)) saveType= "cxx";
   return saveType;
}

//______________________________________________________________________________
QString TGQt::QtFileFormat(const char *selector)
{ return QtFileFormat(QString(selector)); }

//______________________________________________________________________________
QString TGQt::QtFileFormat(const QString &selector)
{
   // returns Qt file format
   //
   // if no suitable format found and the selector is empty
   // the default PNG format is returned
   //
   // a special treatment of the "gif" format.
   // If "gif" is not provided with the local Qt installation
   // replace "gif" format with "png" one
   //
   QString saveType="PNG"; // it is the default format
   if (!selector.isEmpty())  {
      QList<QByteArray> formats =  QImageWriter::supportedImageFormats();
      QList<QByteArray>::const_iterator j;
      for (j = formats.constBegin(); j != formats.constEnd(); ++j)
      {
         QString nextFormat =  *j;
         // Trick to count both "jpeg" and "jpg" extenstion
         QString checkString = selector.contains("jpg",Qt::CaseInsensitive) ? "JPEG" : selector;
         if (checkString.contains(nextFormat,Qt::CaseInsensitive) ) {
            saveType = nextFormat;
            break;
         }
      }
      // a special treatment of the "gif" format.
      // If "gif" is not provided with the local Qt installation
      // replace "gif" format with "png" one
      // -- if (saveType.isEmpty() && selector.contains("gif",FALSE)) saveType="PNG";
   }
   return saveType;
}

//______________________________________________________________________________
TQtApplication *TGQt::CreateQtApplicationImp()
{
   // The method to instantiate the QApplication if needed
   static TQtApplication *app = 0;
   if (!app) {
      //    app = new TQtApplication(gApplication->ApplicationName(),gApplication->Argc(),gApplication->Argv());
      static TString argvString (
#ifdef ROOTBINDIR
				 ROOTBINDIR "/root.exe"
#else
				 "$ROOTSYS/bin/root.exe"
#endif
				 );
      gSystem->ExpandPathName(argvString);
      static char *argv[] = {(char *)argvString.Data()};
      static int nArg = 1;
      app = new TQtApplication("Qt",nArg,argv);
   }
   return app;
}

//______________________________________________________________________________
void TGQt::PostQtEvent(QObject *receiver, QEvent *event)
{
   // Qt announced that QThread::postEvent to become obsolete and
   // we have to switch to the QAppication instead.
  QApplication::postEvent(receiver,event);
}

//______________________________________________________________________________
TGQt::TGQt() : TVirtualX(),fDisplayOpened(kFALSE),fQPainter(0),fhEvent ()
,fQBrush(),fQPen(),fQtMarker(),fQFont(),fQClientFilter(),fQClientFilterBuffer(0)
,fPointerGrabber(),fCodec(0),fSymbolFontFamily("Symbol"),fQtEventHasBeenProcessed(0)
,fFeedBackMode(kFALSE),fFeedBackWidget(0),fBlockRGB(kFALSE),fUseTTF(kTRUE)      
{
   //*-*-*-*-*-*-*-*-*-*-*-*Default Constructor *-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                    ===================
   assert(!fgTQt);
   fgTQt = this;
   gQt   = this;
   fSelectedWindow = fPrevWindow = NoOperation;
}

//______________________________________________________________________________
TGQt::TGQt(const char *name, const char *title) : TVirtualX(name,title),fDisplayOpened(kFALSE)
,fQPainter(0),fhEvent(),fCursors(kNumCursors),fQClientFilter(0),fQClientFilterBuffer(0),fPointerGrabber(0)
,fCodec(0),fSymbolFontFamily("Symbol"),fQtEventHasBeenProcessed(0)
,fFeedBackMode(kFALSE),fFeedBackWidget(0),fBlockRGB(kFALSE),fUseTTF(kTRUE)
{
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*Normal Constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                        ==================                              *-*
   assert(!fgTQt);
   fgTQt = this;
   gQt   = this;
   fSelectedWindow = fPrevWindow = NoOperation;
   CreateQtApplicationImp();
   Init();
}

//______________________________________________________________________________
TGQt::~TGQt()
{
   //*-*-*-*-*-*-*-*-*-*-*-*Default Destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                    ==================
   {  // critical section
      TQtLock lock;
      gVirtualX = gGXBatch;
      gROOT->SetBatch();
      // clear the color map
      QMap<Color_t,QColor*>::const_iterator it;
      for (it = fPallete.begin();it !=fPallete.end();++it) {
         QColor *c = *it; delete c;
      }
       qDeleteAll(fCursors.begin(), fCursors.end());

      delete fQClientFilter;       fQClientFilter = 0;
      delete fQClientFilterBuffer; fQClientFilterBuffer = 0;
      delete fgTextProxy;          fgTextProxy = 0;
 // ---     delete fQPainter; fQPainter = 0;
   }
   // Stop GUI thread
   TQtApplication::Terminate();
   // fprintf(stderr, "TGQt::~TGQt()<------\n");
}

//______________________________________________________________________________
Bool_t TGQt::Init(void* /*display*/)
{
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*Qt GUI initialization-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                        ========================                      *-*
   fprintf(stderr,"** $Id: TGQt.cxx 36275 2010-10-11 08:05:21Z brun $ this=%p\n",this);
#ifndef R__QTWIN32
   extern void qt_x11_set_global_double_buffer(bool);
//   qt_x11_set_global_double_buffer(false);
#endif

   if(fDisplayOpened)   return fDisplayOpened;
   fSelectedWindow = fPrevWindow = NoOperation;
   fTextAlignH      = 1;
   fTextAlignV      = 1;
   fTextMagnitude   = 1;
   fCharacterUpX    = 1;
   fCharacterUpY    = 1;
   fDrawMode        = QPainter::CompositionMode_Source; // Qt::CopyROP;
   fTextFontModified = 0;

   fTextAlign   = 0;
   fTextSize    = -1;
   fTextFont    = -1;
   fLineWidth   = -1;
   fFillColor   = -1;
   fLineColor   = -1;
   fLineStyle   = -1;
   fMarkerSize  = -1;
   fMarkerStyle = -1;

   //
   // Retrieve the application instance
   //

   // --   fHInstance = GetModuleHandle(NULL);

   //
   // Create cursors
   //
   // Qt::BlankCursor - blank/invisible cursor
   // Qt::BitmapCursor

   fCursors[kBottomLeft]  = new QCursor(Qt::SizeBDiagCursor); // diagonal resize (/) LoadCursor(NULL, IDC_SIZENESW);// (display, XC_bottom_left_corner);
   fCursors[kBottomRight] = new QCursor(Qt::SizeFDiagCursor); // diagonal resize (\) LoadCursor(NULL, IDC_SIZENWSE);// (display, XC_bottom_right_corner);
   fCursors[kTopLeft]     = new QCursor(Qt::SizeFDiagCursor); // diagonal resize (\)  (display, XC_top_left_corner);
   fCursors[kTopRight]    = new QCursor(Qt::SizeBDiagCursor); // diagonal resize (/) LoadCursor(NULL, IDC_SIZENESW);// (display, XC_top_right_corner);
   //fCursors[kBottomSide] = new QCursor(Qt::SplitHCursor);    // - horziontal splitting LoadCursor(NULL, IDC_SIZENS);  // (display, XC_bottom_side);
   //fCursors[kLeftSide]   = new QCursor(Qt::SplitVCursor);    // - vertical splitting LoadCursor(NULL, IDC_SIZEWE);  // (display, XC_left_side);
   //fCursors[kTopSide]    = new QCursor(Qt::SplitHCursor);    // - horziontal splitting LoadCursor(NULL, IDC_SIZENS);  // (display, XC_top_side);
   //fCursors[kRightSide]  = new QCursor(Qt::SplitVCursor);    // - vertical splitting LoadCursor(NULL, IDC_SIZEWE);  // (display, XC_right_side);
   fCursors[kBottomSide]  = new QCursor(Qt::SizeVerCursor);   // - horziontal splitting LoadCursor(NULL, IDC_SIZENS);  // (display, XC_bottom_side);
   fCursors[kLeftSide]    = new QCursor(Qt::SizeHorCursor);   // - vertical splitting LoadCursor(NULL, IDC_SIZEWE);  // (display, XC_left_side);
   fCursors[kTopSide]     = new QCursor(Qt::SizeVerCursor);   // - horziontal splitting LoadCursor(NULL, IDC_SIZENS);  // (display, XC_top_side);
   fCursors[kRightSide]   = new QCursor(Qt::SizeHorCursor);   // - vertical splitting LoadCursor(NULL, IDC_SIZEWE);  // (display, XC_right_side);

   fCursors[kMove]        = new QCursor(Qt::SizeAllCursor);   //  all directions resize LoadCursor(NULL, IDC_SIZEALL); // (display, XC_fleur);
   fCursors[kCross]       = new QCursor(Qt::CrossCursor);     // - crosshair LoadCursor(NULL, IDC_CROSS);   // (display, XC_tcross);
   fCursors[kArrowHor]    = new QCursor(Qt::SizeHorCursor);   //   horizontal resize LoadCursor(NULL, IDC_SIZEWE);  // (display, XC_sb_h_double_arrow);
   fCursors[kArrowVer]    = new QCursor(Qt::SizeVerCursor);   //  vertical resize LoadCursor(NULL, IDC_SIZENS)  (display, XC_sb_v_double_arrow);
   fCursors[kHand]        = new QCursor(Qt::PointingHandCursor); //  a pointing hand LoadCursor(NULL, IDC_NO);      // (display, XC_hand2);
   fCursors[kRotate]      = new QCursor(Qt::ForbiddenCursor); // - a slashed circle LoadCursor(NULL, IDC_ARROW);    // (display, XC_exchange);
   fCursors[kPointer]     = new QCursor(Qt::ArrowCursor);     // standard arrow cursor  / (display, XC_left_ptr);
   fCursors[kArrowRight]  = new QCursor(Qt::UpArrowCursor);   // - upwards arrow LoadCursor(NULL, IDC_ARROW);   // XC_arrow
   fCursors[kCaret]       = new QCursor(Qt::IBeamCursor);     //  ibeam/text entry LoadCursor(NULL, IDC_IBEAM);   // XC_xterm
   fCursors[kWatch]       = new QCursor(Qt::WaitCursor);      //

   // The default cursor

   fCursor = kCross;

   // Qt object used to paint the canvas
   fQPen     = new TQtPen;
   fQBrush   = new TQtBrush;
   fQtMarker = new TQtMarker;
   fQFont    = new TQtPadFont();
   // ((TGQt *)TGQt::GetVirtualX())->SetQClientFilter(
   fQClientFilter = new TQtClientFilter();

   //  Query the default font for Widget decoration.
   fFontTextCode = "ISO8859-1";
   const char *default_font =
      gEnv->GetValue("Gui.DefaultFont",  "-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
   QFont *dfFont = (QFont *)LoadQueryFont(default_font);
   QApplication::setFont(*dfFont);
   delete dfFont;
   //  define the font code page
   QString fontName(default_font);
   fFontTextCode = fontName.section('-',13). toUpper();
   if  ( fFontTextCode.isEmpty() ) fFontTextCode = "ISO8859-5";
#ifndef R__QTWIN32
   // Check whether "Symbol" font is available
    QFontDatabase fdb;
    QString fontFamily;
    QStringList families = fdb.families();
    Bool_t symbolFontFound = kFALSE;
    Bool_t isXdfSupport = !gSystem->Getenv("QT_X11_NO_FONTCONFIG");
    for ( QStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
        // qDebug() << "Next Symbol font family found:" << *f << fdb.writingSystems(*f);
       if ( (isXdfSupport && (*f).contains(fSymbolFontFamily)
             && fdb.writingSystems(*f).contains(QFontDatabase::Symbol)
         )  || (!isXdfSupport && ((*f) == fSymbolFontFamily)) )
        {
           symbolFontFound = kTRUE;
           qDebug() << "Symbol font family found: " <<  *f;
           if (*f == "Standard Symbols L") { fontFamily = *f; break; }
        }
    }

    if (isXdfSupport && !symbolFontFound) {
// Load the local ROOT font
       QString fontdir =
#ifdef TTFFONTDIR
    		TTFFONTDIR
#else
		  "$ROOOTSYS/fonts"
#endif
        ;
        QString symbolFontFile = fontdir + "/" + QString(fSymbolFontFamily).toLower() + ".ttf";
        symbolFontFound = QFontDatabase::addApplicationFont(symbolFontFile);
    }
    if (!symbolFontFound) {
        fprintf(stderr, "The font \"symbol.ttf\" was not installed yet\n");
         //  provide the replacement and the codec
        fontFamily = fSymbolFontFamily = "Arial";
        qDebug() << " Substitute it with \""<<fontFamily <<"\"";
        qDebug() << " Make sure your local \"~/.fonts.conf\" or \"/etc/fonts/fonts.conf\" file points to \""
                 << 
#ifdef TTFFONTDIR
		TTFFONTDIR
#else
		"$ROOOTSYS/fonts"
#endif
		<< "\" directory to get the proper support for ROOT TLatex class";
        // create a custom codec
        new QSymbolCodec();
    }
    if (symbolFontFound) TQtPadFont::SetSymbolFontFamily(fontFamily.toAscii().data());
#endif
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)
       fUseTTF=gEnv->GetValue("Qt.Screen.TTF",kFALSE);
#else
       fUseTTF=gEnv->GetValue("Qt.Screen.TTF",kTRUE);
#endif
   //  printf(" TGQt::Init finsihed\n");
   // Install filter for the desktop
   // QApplication::desktop()->installEventFilter(QClientFilter());
   fWidgetArray =  new TQWidgetCollection();
   fDisplayOpened = kTRUE;
   TQtEventInputHandler::Instance();
   // Add $QTDIR include  path to the  list of includes for ACliC
   // make sure Qt SDK does exist.
   if (gSystem->Getenv("QTDIR")) {
      TString qtdir = "$(QTDIR)/include/";
      // Expand the QTDIR first to avoid the cross-platform issue
      gSystem->ExpandPathName(qtdir);
      TString testQtHeader = qtdir + "Qt/qglobal.h";
      if (!gSystem->AccessPathName((const char *)testQtHeader) ) {
         void *qtdirHandle = gSystem->OpenDirectory(qtdir);
         if (qtdirHandle) {
            TString incpath = " -I"; incpath+=qtdir;
            while(const char *nextQtInclude = gSystem->GetDirEntry(qtdirHandle)) {
               // Skip the hidden directories including the current "." and parent ".."
               if (nextQtInclude[0] != '.')  {
                     incpath += " -I"; incpath+=qtdir; incpath+=nextQtInclude;
               }
            }
            gSystem->FreeDirectory(qtdirHandle);
            gSystem->AddIncludePath((const char*)incpath);
         }
#ifdef R__WIN32
         QString libPath = gSystem->GetLinkedLibs();
         // detect the exact name of the Qt library
         TString qtlibdir= "$(QTDIR)";
         qtlibdir += QDir::separator().toAscii();
         qtlibdir += "lib";

         gSystem->ExpandPathName(qtlibdir);
         QDir qtdir((const char*)qtlibdir);
         if (qtdir.isReadable ()) {
            QStringList qtLibFile =  qtdir.entryList(QStringList("Q*4.lib"),QDir::Files);
            QStringListIterator libFiles(qtLibFile);
            if (libFiles.hasNext()) {
               libPath += " -LIBPATH:\"";libPath += qtlibdir;  libPath += "\" ";
#if 0
               while (libFiles.hasNext()) {
                  QString nf = libFiles.next();
                  if (nf.contains("d4")) continue; // skip the debug version of the libraries
                  libPath += nf.toLocal8Bit().constData();
                  libPath += " ";
               }
#else
                  libPath += "QtCore4.lib QtGui4.lib QtOpenGL4.lib Qt3Support4.lib";
#endif
               gSystem->SetLinkedLibs(libPath.toAscii().data());
            }
         } else {
            qWarning(" Can not open the QTDIR %s",(const char*)qtlibdir);
         }
#endif
      }
   }
   TString newPath =
# ifdef CINTINCDIR
      CINTINCDIR
# else
   "$(ROOTSYS)/cint/"
# endif
     ; newPath += "include";
#ifndef R__WIN32
   newPath += ":";
#else
   newPath += ";";
#endif
   newPath += gSystem->GetDynamicPath();
   gSystem->SetDynamicPath(newPath.Data());
   return fDisplayOpened;
}

//______________________________________________________________________________
Int_t TGQt::CreatROOTThread()
{
//*-*-*-*-*dummy*-*-*-*-*-*-*-*-*
//*-*
  return 0;
}
//______________________________________________________________________________
Int_t  TGQt::RegisterWid(QPaintDevice *wd)
{
 // register QWidget for the embedded TCanvas
   Int_t id = fWidgetArray->find(wd);
   if (id == -1) id = fWidgetArray->GetFreeId(wd);
   return id;
}
//______________________________________________________________________________
Int_t  TGQt::UnRegisterWid(QPaintDevice *wd)
{
   // unregister QWidget to the TCanvas
   // return  = Root registration Id or zero if the wd was not registered
   return fWidgetArray->RemoveByPointer(wd);
}
//______________________________________________________________________________
Bool_t  TGQt::IsRegistered(QPaintDevice *wd)
{
   // Check whether the object has been registered
   return fWidgetArray->find(wd) == -1 ? kFALSE : kTRUE;
}
//______________________________________________________________________________
Int_t TGQt::InitWindow(ULong_t window)
{
   //*-*
   //*-*  if window == 0 InitWindow creates his own instance of  TQtWindowsObject object
   //*-*
   //*-*  Create a new windows
   //*-*
   // window is QWidget
   TQtWidget *wd    = 0;
   QWidget   *parent = 0;
   if (window <= fWidgetArray->MaxId() )
      parent = dynamic_cast<TQtWidget *> (iwid(int     (window)));
   else {
      QPaintDevice *dev = dynamic_cast<QPaintDevice *>(iwid(Window_t(window)));
      parent = dynamic_cast<QWidget *>(dev);
   }

 //     QWidget *parent = (window == kDefault) ? 0 : dynamic_cast<QWidget *>(iwid(window));
 //   QWidget *parent = (window == kDefault) ? 0 : (QWidget *)iwid(window);
   wd = new TQtWidget(parent,"virtualx",Qt::FramelessWindowHint,FALSE);
   wd->setCursor(*fCursors[kCross]);
   Int_t id = fWidgetArray->GetFreeId(wd);
   // The default mode is the double buffer mode
   wd->SetDoubleBuffer(1);
   // fprintf(stderr," TGQt::InitWindow %d id=%d device=%p buffer=%p\n",window,id,wd,&wd->GetBuffer());
   return id;
}

//______________________________________________________________________________
Int_t TGQt::OpenPixmap(UInt_t w, UInt_t h)
{
   //*-*  Create a new pixmap object
   QPixmap *obj =  new QPixmap(w,h);
   // fprintf(stderr," TGQt::OpenPixmap %d %d %p\n",w,h,obj);
   return fWidgetArray->GetFreeId(obj);
   // return iwid(obj);
}

//______________________________________________________________________________
const QColor &TGQt::ColorIndex(Color_t ic) const
{
   // Define the QColor object by ROOT color index
   QColor *colorBuffer=0;
   static QColor unknownColor;
   // There are three different ways in ROOT to define RGB.
   // It took 4 months to figure out.
   // See #ifndef R_WIN32 with  TColor::SetRGB method
   if (!fPallete.contains(ic)) {
       Warning("ColorIndex","Unknown color. No RGB component for the index %d was defined\n",ic);
       return unknownColor;
   } else {
      // Make sure the alpha channel was set properly
      // due lack of the TVirtualX interface to account it elsewhere
      TColor *myColor = gROOT->GetColor(ic);
      Float_t a = myColor->GetAlpha();
      colorBuffer = fPallete[ic];
      if (TMath::Abs(colorBuffer->alphaF() - a) > 0.01) {
         colorBuffer->setAlphaF(a);
      }
   }
   return *colorBuffer;
}

//______________________________________________________________________________
UInt_t TGQt::ExecCommand(TGWin32Command* /*command*/)
{
   // deprecated
   fprintf(stderr,"** Error **:  TGQt::ExecCommand no implementation\n");
   return 0;
}

//______________________________________________________________________________
void TGQt::SetDoubleBufferOFF()
{
   // deprecated
   fprintf(stderr,"** Error **:  TGQt::SetDoubleBufferOFF no implementation\n");
}

//______________________________________________________________________________
void TGQt::SetDoubleBufferON()
{
   // deprecated
   fprintf(stderr,"** Error **:  TGQt::SetDoubleBufferON no implementation\n");
}

//______________________________________________________________________________
void TGQt::GetPlanes(Int_t &nplanes){
//*-*-*-*-*-*-*-*-*-*-*-*Get maximum number of planes*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                    ============================
//*-*  nplanes     : number of bit planes
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   nplanes  = QPixmap::defaultDepth();
}

//______________________________________________________________________________
void  TGQt::ClearWindow()
{
   // Clear current window.
   if (fSelectedWindow && fSelectedWindow != NoOperation)
   {
      if (IsWidget(fSelectedWindow)) {
         ((TQtWidget *)fSelectedWindow)->Erase();
      } else if (IsPixmap(fSelectedWindow) ) {
         ((QPixmap *)fSelectedWindow)->fill(fQBrush->color()); // Qt::transparent);
      } else {
         TQtPainter p(this);
         p.eraseRect(GetQRect(*fSelectedWindow));
      }
   }
}

//______________________________________________________________________________
void  TGQt::ClosePixmap()
{
   // Delete the current pixmap.
   DeleteSelectedObj();
}

//______________________________________________________________________________
void  TGQt::CloseWindow()
{
   // Delete the current window.
   DeleteSelectedObj();
}

//______________________________________________________________________________
void  TGQt::DeleteSelectedObj()
{
    // Delete the current Qt object
  if (fSelectedWindow->devType() == QInternal::Widget) {
     TQtWidget *canvasWidget = dynamic_cast<TQtWidget *>(fSelectedWindow);
     if (canvasWidget) {
        canvasWidget->ResetCanvas();
     }
     QWidget *wrapper = 0;
     if (canvasWidget && (wrapper=canvasWidget->GetRootID())) {
        wrapper->hide();
        DestroyWindow(rootwid(wrapper) );
     } else {
        // check whether we are still registered
        if(UnRegisterWid(fSelectedWindow) != (Int_t) kNone) {
           ((QWidget *)fSelectedWindow)->hide();
           ((QWidget *)fSelectedWindow)->close();
        }
     }
  } else {
     UnRegisterWid(fSelectedWindow);
     delete  fSelectedWindow;
  }
  fClipMap.remove(fSelectedWindow);
  fSelectedWindow = 0;
  fPrevWindow     = 0;
}

//______________________________________________________________________________
QRect TGQt::GetQRect(QPaintDevice &dev)
{
   // Define the rectangle of the current ROOT selection
  QRect res(0,0,0,0);

  switch (dev.devType() ) {
  case QInternal::Widget:
    res = ((TQtWidget*)&dev)->rect();
    break;

  default:
     res.setSize(QSize(dev.width(),dev.height()));
     break;
  };
  return res;
}

//______________________________________________________________________________
void  TGQt::CopyPixmap(int wd, int xpos, int ypos)
{
   // Copy the pixmap wd at the position xpos, ypos in the current window.

   if (!wd || (wd == -1) ) return;
   QPaintDevice *dev = iwid(wd);
   assert(dev->devType() == QInternal::Pixmap);
   QPixmap *src = (QPixmap *)dev;
     //  QPixmap *src = (QPixmap *)(QPaintDevice *)wd;
     //  fprintf(stderr," TGQt::CopyPixmap Selected = %p, Buffer = %p, wd = %p\n",
     //  fSelectedWindow,fSelectedBuffer,iwid(wd));
   if (fSelectedWindow )
   {
      QPaintDevice *dst = fSelectedWindow;
      if (dst == (QPaintDevice *)-1) {
         Error("TGQt::CopyPixmap","Wrong TGuiFactory implementation was provided. Please, check your plugin settings");
         assert(dst != (QPaintDevice *)-1);
      }
      bool itIsWidget = fSelectedWindow->devType() == QInternal::Widget;
      TQtWidget *theWidget = 0;
      if (itIsWidget) { 
          theWidget =  (TQtWidget *)fSelectedWindow;
          dst = theWidget->GetOffScreenBuffer();
      }
      { 
        QPainter paint(dst);
        paint.drawPixmap(xpos,ypos,*src);
      }
      Emitter()->EmitPadPainted(src);
      if (theWidget)  theWidget->EmitCanvasPainted();
   }
}
//______________________________________________________________________________
void TGQt::CopyPixmap(const QPixmap &src, Int_t xpos, Int_t ypos)
{
   // Copy the pixmap p at the position xpos, ypos in the current window.
   if (fSelectedWindow )
   {
      QPaintDevice *dst = fSelectedWindow;
      QPainter paint(dst); paint.drawPixmap(xpos,ypos,src);
   }
}
//______________________________________________________________________________
void TGQt::CreateOpenGLContext(int wd)
{
 // Create OpenGL context for win windows (for "selected" Window by default)
 // printf(" TGQt::CreateOpenGLContext for wd = %x fSelected= %x, threadID= %d \n",wd,fSelectedWindow,
 //    GetCurrentThreadId());
  if (!wd || (wd == -1) ) return;

#ifdef QtGL
    if (!wd)
    {
      SafeCallWin32
         ->W32_CreateOpenGL();
    }
    else
    {
      SafeCallW32(((TQtSwitch *)wd))
         ->W32_CreateOpenGL();
    }
#endif

}

//______________________________________________________________________________
void TGQt::DeleteOpenGLContext(int wd)
{
  // Delete OpenGL context for win windows (for "selected" Window by default)
  if (!wd || (wd == -1) ) return;

#ifdef QtGL
    if (!wd)
    {
      SafeCallWin32
         ->W32_DeleteOpenGL();
    }
    else
    {
      SafeCallW32(((TQtSwitch *)wd))
         ->W32_DeleteOpenGL();
    }
#endif
}

//______________________________________________________________________________
void  TGQt::DrawBox(int x1, int y1, int x2, int y2, EBoxMode mode)
{
   // Draw a box.
   // mode=0 hollow  (kHollow)
   // mode=1 solid   (kSolid)
#if QT_VERSION < 0x40000
   static const int Q3=1;
#else
   // Read: http://doc.trolltech.com/4.3/porting4.html
   // "In Qt 4, the result of drawing a QRect with
   //  a pen width of 1 pixel is 1 pixel wider and
   //  1 pixel taller than in Qt 3 "

   static const int Q3=0;
#endif
   if (!fSelectedWindow ) return;
   TQtLock lock;
   // Some workaround to fix issue from TBox::ExecuteEvent case pC. 
   // The reason of the problem has not been found yet.
   // By some reason TBox::ExecuteEvent messes y2 and y1
   if (y2 > y1) {
	   // swap them :-(()
	   int swap = y1; 
	   y1=y2; y2=swap;
   }
   if (x1 > x2) {
	   // swap them :-(()
	   int swap = x1; 
	   x1=x2; x2=swap;
   }
   if ( (fSelectedWindow->devType() ==  QInternal::Widget) && fFeedBackMode && fFeedBackWidget) {
      fFeedBackWidget->SetGeometry(x1,y2,x2-x1,y1-y2,(TQtWidget *)fSelectedWindow);
      if (fFeedBackWidget->isHidden() ) fFeedBackWidget->Show();
      return;
   }

   if ((mode == kHollow) || (fQBrush->style() == Qt::NoBrush) )
   { 
      TQtPainter p(this,TQtPainter::kUpdatePen);
      p.setBrush(Qt::NoBrush);
      p.drawRect(x1,y2,x2-x1+Q3,y1-y2+Q3);
   } else if (fQBrush->GetColor().alpha() ) {
      TQtPainter p(this);
      if (fQBrush->style() != Qt::SolidPattern) p.setPen(fQBrush->GetColor());
      p.fillRect(x1,y2,x2-x1,y1-y2,*fQBrush);
   }
}

//______________________________________________________________________________
void  TGQt::DrawCellArray(int x1, int y1, int x2, int y2, int nx, int ny, int *ic)
{
   // Draw a cell array.
   // x1,y1        : left down corner
   // x2,y2        : right up corner
   // nx,ny        : array size
   // ic           : array
   //
   // Draw a cell array. The drawing is done with the pixel precision
   // if (X2-X1)/NX (or Y) is not a exact pixel number the position of
   // the top rigth corner may be wrong.

   TQtLock lock;
   if (fSelectedWindow)
   {
      int i,j,icol,ix,w,h,current_icol,lh;

      current_icol = -1;
      w            = TMath::Max((x2-x1)/(nx),1);
      h            = TMath::Max((y1-y2)/(ny),1);
      lh           = y1-y2;
      ix           = x1;

      if (w+h == 2)
      {
         //*-*  The size of the box is equal a single pixel
         TQtPainter p(this,TQtPainter::kUpdatePen);
         for ( i=x1; i<x1+nx; i++){
            for (j = 0; j<ny; j++){
               icol = ic[i+(nx*j)];
               if (current_icol != icol) {
                  current_icol = icol;
                  p.setPen(ColorIndex(current_icol));
               }
               p.drawPoint(i,y1-j);
            }
         }
      }
      else
      {
         //*-* The shape of the box is a rectangle
         QRect box(x1,y1,w,h);
         TQtPainter p(this,TQtPainter::kNone);
         for ( i=0; i<nx; i++ ) {
            for ( j=0; j<ny; j++ ) {
               icol = ic[i+(nx*j)];
               if(icol != current_icol){
                  current_icol = icol;
                  p.setBrush(ColorIndex(current_icol));
               }
               p.drawRect(box);
               box.translate(0,-h);   // box.top -= h;
            }
            box.translate(w,lh);
         }
      }
   }
}

//______________________________________________________________________________
void  TGQt::DrawFillArea(int n, TPoint *xy)
{
   // Fill area described by polygon.
   // n         : number of points
   // xy(2,n)   : list of points

   TQtLock lock;
   if (fSelectedWindow && n>0)
   {
      TQtPainter p(this);
      if (fQBrush->style() == Qt::SolidPattern) p.setPen(Qt::NoPen);
      QPolygon qtPoints(n);
      TPoint *rootPoint = xy;
      for (int i =0;i<n;i++,rootPoint++) qtPoints.setPoint(i,rootPoint->fX,rootPoint->fY);
      p.drawPolygon(qtPoints);
   }
}

//______________________________________________________________________________
void  TGQt::DrawLine(int x1, int y1, int x2, int y2)
{
   // Draw a line.
   // x1,y1        : begin of line
   // x2,y2        : end of line

  TQtLock lock;
  if (fSelectedWindow) {
     TQtToggleFeedBack  feedBack(this);
     feedBack.painter().drawLine(x1,y1,x2,y2);
#if 0
     if (x1> 1000) {
        // Qt 4.5.x bug
       qDebug() << "TGQt::DrawLine " << " x1=" << x1 
                                   << " y1=" << y1
                                   << " x2=" << x2
                                   << " y2=" << y2;
       //assert(0 && "Weird coordinate");
     }
#endif
  }
}

//______________________________________________________________________________
void  TGQt::DrawPolyLine(int n, TPoint *xy)
{
   // Draw a line through all points.
   // n         : number of points
   // xy        : list of points

  TQtLock lock;
  if (fSelectedWindow)  {
     TQtToggleFeedBack  feedBack(this);
     QPolygon qtPoints(n);
     TPoint *rootPoint = xy;
     for (int i =0;i<n;i++,rootPoint++) qtPoints.setPoint(i,rootPoint->fX,rootPoint->fY);
     feedBack.painter().drawPolyline(qtPoints);
  }
}

//______________________________________________________________________________
void  TGQt::DrawPolyMarker(int n, TPoint *xy)
{
   // Draw n markers with the current attributes at position x, y.
   // n    : number of markers to draw
   // xy   : x,y coordinates of markers
   TQtLock lock;
   if (fSelectedWindow) {
      TQtPainter p(this,TQtPainter::kNone);
		fQtMarker->DrawPolyMarker(p,n,xy);
   }
}
//______________________________________________________________________________
TQtTextProxy  *TGQt::TextProxy()
{
   // Get the text proxy implementation pointer
   return fgTextProxy;
}
//______________________________________________________________________________
void  TGQt::SetTextProxy(TQtTextProxy  *proxy)
{
   // Set the text proxy implementation pointer
   fgTextProxy = proxy;
}

//______________________________________________________________________________
void  TGQt::DrawText(int x, int y, float angle, float mgn, const char *text, TVirtualX::ETextMode /*mode*/)
{

   // Draw a text string using current font.
   // mode       : drawing mode
   // mode=0     : the background is not drawn (kClear)
   // mode=1     : the background is drawn (kOpaque)
   // x,y        : text position
   // angle      : text angle
   // mgn        : magnification factor
   // text       : text string


   // fprintf(stderr,"TGQt::DrawText: %s\n", text);
   if (text && text[0]) {
      TQtLock lock;
      fQFont->SetTextMagnify(mgn);
      TQtPainter p(this,TQtPainter::kUpdateFont);
      p.setPen(ColorIndex(fTextColor));
      p.setBrush(ColorIndex(fTextColor));
      unsigned int w=0;unsigned int h=0; unsigned int d = 0;
      bool textProxy = false;
      TQtTextCloneProxy proxy;
      if (fgTextProxy) {
         proxy->clear();
         QFontInfo fi(*fQFont);
         proxy->setBaseFontPointSize(fi.pointSize());
         proxy->setForegroundColor(ColorIndex(fTextColor));
         if ( ( textProxy = proxy->setContent(text) ) ) {
             w = proxy->width();
             h = proxy->height();
         }
      } 
      if (!textProxy) {
         QFontMetrics metrics(*fQFont);
         QRect bRect = metrics.boundingRect(text);
         w = bRect.width();
         h = bRect.height();
         d = metrics.descent();
      }
      p.translate(x,y);
      if (TMath::Abs(angle) > 0.1 ) p.rotate(-angle);
      int dx =0; int dy =0;
      
      switch( fTextAlignH ) {
           case 2: dx = -int(w/2);                  // h center;
              break;
           case 3: dx = -int(w);                    //  Right;
              break;
      };
      switch( fTextAlignV ) {
          case 2: dy = h/2 - d; // v center // metrics.strikeOutPos();
             break;
          case 3: dy = h   - d; // AlignTop;
      };
      if (textProxy)
         proxy->paint(&p,dx,-dy);
      else
         p.drawText (dx, dy, GetTextDecoder()->toUnicode (text));
   }
}

//______________________________________________________________________________
void  TGQt::GetCharacterUp(Float_t &chupx, Float_t &chupy)
{
   // Return character up vector.

   TQtLock lock;
   chupx = fCharacterUpX;
   chupy = fCharacterUpY;
}

//______________________________________________________________________________
QPaintDevice *TGQt::GetDoubleBuffer(QPaintDevice *dev)
{
   // Query the pointer to the dev offscreen buffer if any

   QPaintDevice *buffer = 0;
   if (dev) {
       TQtWidget *widget = dynamic_cast<TQtWidget *>(dev);
       buffer = widget && widget->IsDoubleBuffered() ? widget->SetBuffer().Buffer() : 0;
   }
   return buffer;
}
//______________________________________________________________________________
Int_t  TGQt::GetDoubleBuffer(Int_t wd)
{
   // Query the double buffer value for the window wd.
   // return pointer to the off-screen buffer if any

   if (wd == -1 || wd == kDefault ) return 0;
   assert(0);
   QPaintDevice *dev = iwid(wd);
   TQtWidget *widget = dynamic_cast<TQtWidget *>(dev);
   return  Int_t(widget && widget->IsDoubleBuffered());
}

//______________________________________________________________________________
void  TGQt::GetGeometry(int wd, int &x, int &y, unsigned int &w, unsigned int &h)
{
   // Returns the global cooordinate of the window "wd"
   QRect devSize(0,0,0,0);
   if( wd == -1 || wd == 0 || wd == kDefault)
   {
      QDesktopWidget *d = QApplication::desktop();
      devSize.setWidth (d->width() );
      devSize.setHeight(d->height());
   } else {
      QPaintDevice  *dev = iwid(wd);
      if (dev) {
         if ( dev->devType() == QInternal::Widget) {
            TQtWidget &thisWidget = *(TQtWidget *)dev;
            if (thisWidget.GetRootID() ) {
               // we are using the ROOT Gui factory
               devSize = thisWidget.parentWidget()->geometry();
            } else{
               devSize = thisWidget.geometry();
            }
            devSize.moveTopLeft(thisWidget.mapToGlobal(QPoint(0,0)));
         } else {
            devSize = GetQRect(*dev);
         }
      }
   }
   x = devSize.left();
   y = devSize.top();
   w = devSize.width();
   h = devSize.height();
 //  fprintf(stderr," 2. TGQt::GetGeometry %d %d %d %d %d\n", wd, x,y,w,h);
}

//______________________________________________________________________________
const char *TGQt::DisplayName(const char *){ return "localhost"; }

//______________________________________________________________________________
ULong_t  TGQt::GetPixel(Color_t cindex)
{
   // Return pixel value associated to specified ROOT color number.
   // see: GQTGUI.cxx:QtColor() also
   ULong_t rootPixel = 0;
   const QColor &color = ColorIndex(UpdateColor(cindex));
#ifdef R__WIN32
   rootPixel =                    ( color.blue () & 255 );
   rootPixel = (rootPixel << 8) | ( color.green() & 255 ) ;
   rootPixel = (rootPixel << 8) | ( color.red  () & 255 );
#else
   rootPixel =                    ( color.red ()  & 255 );
   rootPixel = (rootPixel << 8) | ( color.green() & 255 ) ;
   rootPixel = (rootPixel << 8) | ( color.blue  ()& 255 );
#endif
   return rootPixel;
}

//______________________________________________________________________________
void  TGQt::GetRGB(int index, float &r, float &g, float &b)
{
   // Get rgb values for color "index".
   r = g = b = 0;
   TQtLock lock;
   if (fSelectedWindow != NoOperation) {
      qreal R,G,B;
      const QColor &color = *fPallete[index];
      color.getRgbF(&R,&G,&B);
      r = R; g = G; b = G;
   }
}

//______________________________________________________________________________
const QTextCodec *TGQt::GetTextDecoder()
{
   static  QTextCodec  *fGreekCodec = 0;
   QTextCodec  *codec = 0;
   if (!fCodec) {
      fCodec =  QTextCodec::codecForName(fFontTextCode.toAscii()); //CP1251
      if (!fCodec)
         fCodec=QTextCodec::codecForLocale();
      else
         QTextCodec::setCodecForLocale(fCodec);
   }
   codec = fCodec;
   if (fTextFont/10 == 12 ) {
        // We expect the Greek letters and should apply the right Codec
      if (!fGreekCodec) {
         if (QString(fSymbolFontFamily).contains("Symbol")) {
            fGreekCodec = (fFontTextCode == "ISO8859-1") ? fCodec:
                          QTextCodec::codecForName("ISO8859-1"); //iso8859-1
         } else {
            fGreekCodec  = QTextCodec::codecForName("symbol"); // ISO8859-7
         }
      }
      if (fGreekCodec) codec=fGreekCodec;
   }
   return codec;
}

//______________________________________________________________________________
Float_t      TGQt::GetTextMagnitude(){return fTextMagnitude;}

//______________________________________________________________________________
void         TGQt::SetTextMagnitude(Float_t mgn){ fTextMagnitude = mgn;}

//______________________________________________________________________________
void  TGQt::GetTextExtent(unsigned int &w, unsigned int &h, char *mess)
{
   // Return the size of a character string.
   // iw          : text width
   // ih          : text height
   // mess        : message

   TQtLock lock;
   if (fQFont) {
      bool textProxy = false;
      if (fgTextProxy) {
         TQtTextCloneProxy proxy;
         proxy->clear();
         QFontInfo fi(*fQFont);
         proxy->setBaseFontPointSize(fi.pointSize());
         if ( (textProxy = proxy->setContent(mess)) ) {
            w = proxy->width();
            h = proxy->height();
         }
      }
      if (!textProxy) {
         QSize textSize = QFontMetrics(*fQFont).size(Qt::TextSingleLine,GetTextDecoder()->toUnicode(mess)) ;
         w = textSize.width();
         h = (unsigned int)(textSize.height());
      }
      // qDebug() << "  TGQt::GetTextExtent  w=" <<w <<" h=" << h << "font = " 
      //         << fTextFont << " size =" << fTextSize 
      //         << mess;
   }
}
//______________________________________________________________________________
Int_t TGQt::GetFontAscent() const
{
   // Returns ascent of the current font (in pixels).
   // The ascent of a font is the distance from the baseline 
   // to the highest position characters extend to
   Int_t ascent = 0;
   if (fQFont) {
      QFontMetrics fm(*fQFont);
      ascent = fm.ascent(); //+fm.descent();
   }
   return ascent;
}

//______________________________________________________________________________
Int_t TGQt::GetFontDescent() const 
{ 
   // Returns the descent of the current font (in pixels.
   // The descent is the distance from the base line 
   // to the lowest point characters extend to.
   Int_t descent = 0;
   if (fQFont) {
      QFontMetrics fm(*fQFont);
      descent = fm.descent();
   }
   return descent;
}

//______________________________________________________________________________
Bool_t  TGQt::HasTTFonts() const {return fUseTTF;}

//______________________________________________________________________________
void  TGQt::MoveWindow(Int_t wd, Int_t x, Int_t y)
{
   // Move the window wd.
   // wd  : Window identifier.
   // x    : x new window position
   // y    : y new window position

   if (wd != -1 && wd != 0 && wd != kDefault)
   {
      QPaintDevice *widget = iwid(wd);
      assert(widget->devType() == QInternal::Widget );
      ((TQtWidget *)widget)->move(x,y);
   }
}

//______________________________________________________________________________
void  TGQt::PutByte(Byte_t )
{ // deprecated
}

//______________________________________________________________________________
void  TGQt::QueryPointer(int &ix, int &iy)
{
   // Query pointer position.
   // ix       : X coordinate of pointer
   // iy       : Y coordinate of pointer
   QPoint pos = QCursor::pos();
   ix = pos.x(); iy = pos.y();
}

//______________________________________________________________________________
Pixmap_t TGQt::ReadGIF(Int_t x0, Int_t y0, const char *file, Window_t id)
{
   // If id is NULL - loads the specified gif file at position [x0,y0] in the
   // current window. Otherwise creates pixmap from gif file

   Int_t thisId = 0;
   QPixmap *pix = new QPixmap( QString (file) );
   if ( pix->isNull () ) { delete pix; pix = 0;         }
   else {
      thisId=fWidgetArray->GetFreeId(pix);
      if (!id ) { CopyPixmap(thisId,x0,y0); fWidgetArray->DeleteById(thisId); thisId = 0;}
   }
   return thisId;
}

//______________________________________________________________________________
Int_t  TGQt::RequestLocator(Int_t /*mode*/, Int_t /*ctyp*/, Int_t &/*x*/, Int_t &/*y*/)
{
   // deprecated
   return 0;
}
//______________________________________________________________________________
  class requestString : public QDialog {
  public:
    QString   fText;
    QLineEdit fEdit;
    requestString(const char *text="") : QDialog(0
          , Qt::FramelessWindowHint 
          | Qt::WindowStaysOnTopHint
          | Qt::Popup)
          , fText(text),fEdit(this)
    {
       setModal(true);
       connect(&fEdit,SIGNAL( returnPressed () ), this, SLOT( accept() ));
    }
    ~requestString(){;}
  };
//______________________________________________________________________________
Int_t  TGQt::RequestString(int x, int y, char *text)
{
//*-*-*-*-*-*-*-*-*-*-*-*Request string*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                    ==============
//*-*  x,y         : position where text is displayed
//*-*  text        : text displayed (input), edited text (output)
//*-*
//*-*  Request string:
//*-*  text is displayed and can be edited with Emacs-like keybinding
//*-*  return termination code (0 for ESC, 1 for RETURN)
//*-*
//*-*  Return value:
//*-*
//*-*    0     -  input was canceled
//*-*    1     -  input was Ok
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
  int  res = QDialog::Rejected;
  if (fSelectedWindow->devType() == QInternal::Widget ) {
     TQtWidget *w = (TQtWidget *)fSelectedWindow;
     static requestString reqDialog;
     reqDialog.fEdit.setText(QString(text).trimmed());
     int yFrame = reqDialog.frameGeometry().height() - reqDialog.geometry().height() + reqDialog.fontMetrics().height();
     reqDialog.move(w->mapToGlobal(QPoint(x,y-yFrame)));
     if (QClientFilter() && QClientFilter()->PointerGrabber() ) {
        // suspend the mouse grabbing for a while
//        QClientFilter()->SetPointerGrabber(0);
        QClientFilter()->PointerGrabber()->DisactivateGrabbing();
     }
     res = reqDialog.exec();
     if (res == QDialog::Accepted ) {
        // save the currect test font to select the proper codec
        Font_t textFontSave =  fTextFont;
        fTextFont = 62;
        QByteArray obr = GetTextDecoder()->fromUnicode(reqDialog.fEdit.text());
        const char *r = obr.constData();
        qstrcpy(text, (const char *)r);
        // restore the font
        fTextFont = textFontSave;
     }
     reqDialog.hide();
     if (QClientFilter() && QClientFilter()->PointerGrabber()) {
        // Restore the grabbing
//        QClientFilter()->SetPointerGrabber(fPointerGrabber);
        QClientFilter()->PointerGrabber()->ActivateGrabbing();
     }
  }
  return res == QDialog::Accepted ? 1 : 0;
}

//______________________________________________________________________________
void  TGQt::RescaleWindow(int wd, UInt_t w, UInt_t h)
{
   // Rescale the window wd.
   // wd  : Window identifier
   // w    : Width
   // h    : Heigth

   TQtLock lock;
   if (wd && wd != -1 && wd != kDefault )
   {
      QPaintDevice *widget = iwid(wd);
      if (widget->devType() == QInternal::Widget )
      {
         if (QSize(w,h) != ((TQtWidget *)widget)->size()) {
            // fprintf(stderr," TGQt::RescaleWindow(int wd, UInt_t w=%d, UInt_t h=%d)\n",w,h);
            ((TQtWidget *)widget)->resize(w,h);
         }
      }
   }
}

//______________________________________________________________________________
Int_t  TGQt::ResizePixmap(int wd, UInt_t w, UInt_t h)
{
   // Resize a pixmap.
   // wd : pixmap to be resized
   // w,h : Width and height of the pixmap

   TQtLock lock;
   if (wd && wd != -1 && wd != kDefault )
   {
      QPaintDevice *pixmap = iwid(wd);
      if (pixmap->devType() == QInternal::Pixmap )
      {
         if (QSize(w,h) != ((QPixmap *)pixmap)->size()) {
             QPixmap *newpix =  new QPixmap(w,h);
             newpix->fill();
             fWidgetArray->ReplaceById(wd,newpix);
             if (fSelectedWindow == pixmap) fSelectedWindow = newpix;
            // fprintf(stderr," \n --- > Pixmap has been resized ,< --- \t  %p\n",pixmap);
         }
      }
   }
   return 1;
}

//______________________________________________________________________________
void  TGQt::ResizeWindow(int /* wd */)
{
   // Resize the current window if necessary.
   // No implementation is required under Qt.

   return;
}

//______________________________________________________________________________
void   TGQt::SelectPixmap(Int_t qpixid){ SelectWindow(qpixid);}

//______________________________________________________________________________
void  TGQt::SelectWindow(int wd)
{
   // Select window to which subsequent output is directed.
   // fprintf(stderr," TGQt::SelectWindow %d \n", wd);
   // Don't select things twice
   QPaintDevice *dev = 0;
   if (wd == -1 || wd == (int) kNone) {
       fSelectedWindow = NoOperation;
      //return;
   } else {
      dev = iwid(wd);
      fSelectedWindow = dev ? dev : NoOperation;
   }
   if (fPrevWindow != fSelectedWindow) 
      fPrevWindow     = fSelectedWindow;
}

//______________________________________________________________________________
void  TGQt::SetCharacterUp(Float_t chupx, Float_t chupy)
{
   // Set character up vector.

   TQtLock lock;
   if (chupx == fCharacterUpX  && chupy == fCharacterUpY) {

      return;
   }

   if      (chupx == 0  && chupy == 0)  fTextAngle = 0;
   else if (chupx == 0  && chupy == 1)  fTextAngle = 0;
   else if (chupx == -1 && chupy == 0)  fTextAngle = 90;
   else if (chupx == 0  && chupy == -1) fTextAngle = 180;
   else if (chupx == 1  && chupy ==  0) fTextAngle = 270;
   else {
      fTextAngle = ((TMath::ACos(chupx/TMath::Sqrt(chupx*chupx +chupy*chupy))*180.)/3.14159)-90;
      if (chupy < 0) fTextAngle = 180 - fTextAngle;
      if (TMath::Abs(fTextAngle) < 0.01) fTextAngle = 0;
   }

   fCharacterUpX = chupx;
   fCharacterUpY = chupy;
}

//______________________________________________________________________________
void  TGQt::SetClipOFF(Int_t /*wd*/)
{
   // Turn off the clipping for the window wd.
   // deprecated
   // fQPainter->setClipping(FALSE);
}

//______________________________________________________________________________
void  TGQt::SetClipRegion(int wd, int x, int y, UInt_t w, UInt_t h)
{
   // Set clipping region for the window wd.
   // wd        : Window indentifier
   // x,y        : origin of clipping rectangle
   // w,h        : size of clipping rectangle;

   QRect rect(x,y,w,h);
   TQtLock lock;
   fClipMap.remove(iwid(wd));
   fClipMap.insert(iwid(wd),rect);
}

//____________________________________________________________________________
void  TGQt::SetCursor(Int_t wd, ECursor cursor)
{
   // Set the cursor.
   fCursor = cursor;
   if (wd && wd != -1 && wd != kDefault)
   {
      QPaintDevice *widget = iwid(wd);
      if ( TQtWidget *w = (TQtWidget *)IsWidget(widget) )
         w->setCursor(*fCursors[fCursor]);
   }
}

//______________________________________________________________________________
void  TGQt::SetDoubleBuffer(int wd, int mode)
{
   // Set the double buffer on/off on window wd.
   // wd  : Window identifier.
   //        999 means all the opened windows.
   // mode : 1 double buffer is on
   //        0 double buffer is off
   if (wd == -1 || wd == kDefault) return;
   QPaintDevice *dev = iwid(wd);
   TQtWidget *widget = 0;
   if (dev && (widget = (TQtWidget *)IsWidget(dev) ))  {
      widget->SetDoubleBuffer(mode);
      // fprintf(stderr," TGQt::SetDoubleBuffer \n");
   }
}

//______________________________________________________________________________
void  TGQt::SetDrawMode(TVirtualX::EDrawMode mode)
{
   // Set the drawing mode.
   // mode : drawing mode

   // Map EDrawMode    { kCopy = 1, kXor, kInvert };
   Bool_t feedBack =  (mode==kInvert);
   if (feedBack != fFeedBackMode) {
      fFeedBackMode = feedBack;
      if (fFeedBackMode) {
         // create
         if (!fFeedBackWidget) {
            fFeedBackWidget = new TQtFeedBackWidget;
            fFeedBackWidget->setFrameStyle(QFrame::Box);
         }
	 // This makes no sense on X11 yet due the  
	 // TQtWidget::setAttribute(Qt::WA_PaintOnScreen) flag
	 // TQtWidget keeps painting itself over the feedback windows. Wierd !!!
         // reparent if needed
         fFeedBackWidget->SetParent(0);
         fFeedBackWidget->SetParent((TQtWidget *)fSelectedWindow);
      } else if (fFeedBackWidget) {
         fFeedBackWidget->Hide();
      }
   }
#if 0
   QPainter::CompositionMode newMode = QPainter::CompositionMode_Source;
   switch (mode) {
    case kCopy:   newMode = QPainter::CompositionMode_Source; break;
    case kXor:    newMode = QPainter::CompositionMode_Xor;  break;
    case kInvert: newMode = QPainter::CompositionMode_Destination;  break;
    default:      newMode = QPainter::CompositionMode_Source; break;
   };
   if (newMode != fDrawMode)
   {
      fDrawMode = newMode;
//      if (fQPainter->isActive() && (fQPainter->device()->devType() !=  QInternal::Widget ))
      if (fQPainter->isActive() && (fQPainter->device()->devType() ==  QInternal::Image ))
      {
         fQPainter->setCompositionMode(fDrawMode);
     }
     // sfprintf(stderr,"TGQt::SetDrawMode \n");
   }
#endif
}

//______________________________________________________________________________
void  TGQt::SetFillColor(Color_t cindex)
{
   // Set color index for fill areas.

   if (fFillColor != cindex )
      fQBrush->SetColor(fFillColor = UpdateColor(cindex));
}

//______________________________________________________________________________
void  TGQt::SetFillStyle(Style_t fstyle)
{
   // Set fill area style.
   // fstyle   : compound fill area interior style
   //    fstyle = 1000*interiorstyle + styleindex

  //  The current fill area color is used to paint some pixels in a small
  //  rectangle the other pixels are not paint.
  //    Olivier Couet
  //            Thursday, July 14, 2005

   if (fFillStyle != fstyle)
      fQBrush->SetStyle(fFillStyle = fstyle);
}

//______________________________________________________________________________
void TGQt::SetFillStyleIndex( Int_t style, Int_t fasi )
{
   // Set fill area style index.

   SetFillStyle(1000*style + fasi);
}

//______________________________________________________________________________
void  TGQt::SetLineColor(Color_t cindex)
{
//*-*-*-*-*-*-*-*-*-*-*Set color index for lines*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  =========================
//*-*  cindex    : color index
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  if (fLineColor != cindex) {
    fLineColor = UpdateColor(cindex);
    if (fLineColor >= 0) fQPen->SetLineColor(fLineColor);
  }
}

//______________________________________________________________________________
void  TGQt::SetLineType(int n, int*dash)
{
//*-*-*-*-*-*-*-*-*-*-*Set line style-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ==============
//*-*    Set line style:
//*-*    if n < 0 use pre-defined Windows style:
//*-*         0 - solid lines
//*-*        -1 - solid lines
//*-*        -2 - dash line
//*-*        -3 - dot  line
//*-*        -4 - dash-dot line
//*-*        -5 - dash-dot-dot line
//*-*     < -6 - solid line
//*-*
//*-*    if n > 0 use dashed lines described by DASH(N)
//*-*    e.g. n=4,DASH=(6,3,1,3) gives a dashed-dotted line with dash length 6
//*-*    and a gap of 7 between dashes
//*-*
   fQPen->SetLineType(n,dash);
}

//______________________________________________________________________________
void  TGQt::SetLineStyle(Style_t linestyle)
{
//*-*-*-*-*-*-*-*-*-*-*Set line style-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ==============
//*-*    Use pre-defined Windows style:
//*-*    linestyle =
//*-*         0 - solid lines
//*-*        -1 - solid lines
//*-*        -2 - dash line
//*-*        -3 - dot  line
//*-*        -4 - dash-dot line
//*-*        -5 - dash-dot-dot line
//*-*      < -6 - solid line
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   // Copy/Paste from TGX11::SetLineStyle (it is called "subclassing")
   // Set line style.

   if (fLineStyle != linestyle) { //set style index only if different
      fLineStyle = linestyle;
      fQPen->SetLineStyle(linestyle);
   }
}

//______________________________________________________________________________
void  TGQt::SetLineWidth(Width_t width)
{
   //*-*-*-*-*-*-*-*-*-*-*Set line width*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  ==============
   //*-*  width   : line width in pixels
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   if (width==1) width =0;
   if (fLineWidth != width) {
      fLineWidth = width;
      if (fLineWidth >= 0 ) fQPen->SetLineWidth(fLineWidth);
   }
}

//______________________________________________________________________________
void  TGQt::SetMarkerColor( Color_t cindex)
{
   //*-*-*-*-*-*-*-*-*-*-*Set color index for markers*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  ===========================
   //*-*  cindex : color index defined my IXSETCOL
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

	if (fQtMarker->GetColor() != cindex)		
		fQtMarker->SetColor(fMarkerColor = UpdateColor(cindex));
}

//______________________________________________________________________________
void  TGQt::SetMarkerSize(Float_t markersize)
{
   //*-*-*-*-*-*-*-*-*-*-*Set marker size index for markers*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  =================================
   //*-*  msize  : marker scale factor
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   if (markersize != fMarkerSize) {

      fMarkerSize = markersize;
      if (markersize >= 0) {
         SetMarkerStyle(-fMarkerStyle);
      }
   }
}

//______________________________________________________________________________
void  TGQt::SetMarkerStyle(Style_t markerstyle){
   //*-*-*-*-*-*-*-*-*-*-*Set marker style*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  ================

   if (fMarkerStyle == markerstyle) return;
   TPoint shape[15];
   markerstyle  = TMath::Abs(markerstyle);
   if (markerstyle%1000 >= 31) return;
   fMarkerStyle = markerstyle%1000;
   Style_t penWidth = markerstyle-fMarkerStyle;
   Int_t im = Int_t(4*fMarkerSize + 0.5);
   switch (fMarkerStyle) {

case 2:
   //*-*--- + shaped marker
   shape[0].SetX(-im); shape[0].SetY( 0);
   shape[1].SetX(im);  shape[1].SetY( 0);
   shape[2].SetX(0) ;  shape[2].SetY( -im);
   shape[3].SetX(0) ;  shape[3].SetY( im);
   SetMarkerType(4+penWidth,4,shape);
   break;

case 3:
   //*-*--- * shaped marker
   shape[0].SetX(-im);  shape[0].SetY(  0);
   shape[1].SetX( im);  shape[1].SetY(  0);
   shape[2].SetX(  0);  shape[2].SetY(-im);
   shape[3].SetX(  0);  shape[3].SetY( im);
   im = Int_t(0.707*Float_t(im) + 0.5);
   shape[4].SetX(-im);  shape[4].SetY(-im);
   shape[5].SetX( im);  shape[5].SetY( im);
   shape[6].SetX(-im);  shape[6].SetY( im);
   shape[7].SetX( im);  shape[7].SetY(-im);
   SetMarkerType(4+penWidth,8,shape);
   break;

case 4:
case 24:
   //*-*--- O shaped marker
   SetMarkerType(0+penWidth,im*2,shape);
   break;

case 5:
   //*-*--- X shaped marker
   im = Int_t(0.707*Float_t(im) + 0.5);
   shape[0].SetX(-im);  shape[0].SetY(-im);
   shape[1].SetX( im);  shape[1].SetY( im);
   shape[2].SetX(-im);  shape[2].SetY( im);
   shape[3].SetX( im);  shape[3].SetY(-im);
   SetMarkerType(4+penWidth,4,shape);
   break;

case  6:
   //*-*--- + shaped marker (with 1 pixel)
   shape[0].SetX(-1);  shape[0].SetY( 0);
   shape[1].SetX( 1);  shape[1].SetY( 0);
   shape[2].SetX( 0);  shape[2].SetY(-1);
   shape[3].SetX( 0);  shape[3].SetY( 1);
   SetMarkerType(4+penWidth,4,shape);
   break;

case 7:
   //*-*--- . shaped marker (with 9 pixel)
   shape[0].SetX(-1);  shape[0].SetY( 1);
   shape[1].SetX( 1);  shape[1].SetY( 1);
   shape[2].SetX(-1);  shape[2].SetY( 0);
   shape[3].SetX( 1);  shape[3].SetY( 0);
   shape[4].SetX(-1);  shape[4].SetY(-1);
   shape[5].SetX( 1);  shape[5].SetY(-1);
   SetMarkerType(4+penWidth,6,shape);
   break;
case  8:
case 20:
   //*-*--- O shaped marker (filled)
   SetMarkerType(1,im*2,shape);
   break;
case 21:      //*-*- here start the old HIGZ symbols
   //*-*--- HIGZ full square
   shape[0].SetX(-im);  shape[0].SetY(-im);
   shape[1].SetX( im);  shape[1].SetY(-im);
   shape[2].SetX( im);  shape[2].SetY( im);
   shape[3].SetX(-im);  shape[3].SetY( im);
   //     shape[4].SetX(-im);  shape[4].SetY(-im);
   SetMarkerType(3,4,shape);
   break;
case 22:
   //*-*--- HIGZ full triangle up
   shape[0].SetX(-im);  shape[0].SetY( im);
   shape[1].SetX( im);  shape[1].SetY( im);
   shape[2].SetX(  0);  shape[2].SetY(-im);
   //     shape[3].SetX(-im);  shape[3].SetY( im);
   SetMarkerType(3,3,shape);
   break;
case 23:
   //*-*--- HIGZ full triangle down
   shape[0].SetX(  0);  shape[0].SetY( im);
   shape[1].SetX( im);  shape[1].SetY(-im);
   shape[2].SetX(-im);  shape[2].SetY(-im);
   //     shape[3].SetX(  0);  shape[3].SetY( im);
   SetMarkerType(3,3,shape);
   break;
case 25:
   //*-*--- HIGZ open square
   shape[0].SetX(-im);  shape[0].SetY(-im);
   shape[1].SetX( im);  shape[1].SetY(-im);
   shape[2].SetX( im);  shape[2].SetY( im);
   shape[3].SetX(-im);  shape[3].SetY( im);
   //     shape[4].SetX(-im);  shape[4].SetY(-im);
   SetMarkerType(2+penWidth,4,shape);
   break;
case 26:
   //*-*--- HIGZ open triangle up
   shape[0].SetX(-im);  shape[0].SetY( im);
   shape[1].SetX( im);  shape[1].SetY( im);
   shape[2].SetX(  0);  shape[2].SetY(-im);
   //     shape[3].SetX(-im);  shape[3].SetY( im);
   SetMarkerType(2+penWidth,3,shape);
   break;
case 27: {
   //*-*--- HIGZ open losange
   Int_t imx = Int_t(2.66*fMarkerSize + 0.5);
   shape[0].SetX(-imx); shape[0].SetY( 0);
   shape[1].SetX(  0);  shape[1].SetY(-im);
   shape[2].SetX(imx);  shape[2].SetY( 0);
   shape[3].SetX(  0);  shape[3].SetY( im);
   //     shape[4].SetX(-imx); shape[4].SetY( 0);
   SetMarkerType(2+penWidth,4,shape);
   break;
         }
case 28: {
   //*-*--- HIGZ open cross
   Int_t imx = Int_t(1.33*fMarkerSize + 0.5);
   shape[0].SetX(-im);  shape[0].SetY(-imx);
   shape[1].SetX(-imx); shape[1].SetY(-imx);
   shape[2].SetX(-imx); shape[2].SetY( -im);
   shape[3].SetX(imx);  shape[3].SetY( -im);
   shape[4].SetX(imx);  shape[4].SetY(-imx);
   shape[5].SetX( im);  shape[5].SetY(-imx);
   shape[6].SetX( im);  shape[6].SetY( imx);
   shape[7].SetX(imx);  shape[7].SetY( imx);
   shape[8].SetX(imx);  shape[8].SetY( im);
   shape[9].SetX(-imx); shape[9].SetY( im);
   shape[10].SetX(-imx);shape[10].SetY(imx);
   shape[11].SetX(-im); shape[11].SetY(imx);
   //     shape[12].SetX(-im); shape[12].SetY(-imx);
   SetMarkerType(2+penWidth,12,shape);
   break;
         }
case 29: {
   //*-*--- HIGZ full star pentagone
   Int_t im1 = Int_t(0.66*fMarkerSize + 0.5);
   Int_t im2 = Int_t(2.00*fMarkerSize + 0.5);
   Int_t im3 = Int_t(2.66*fMarkerSize + 0.5);
   Int_t im4 = Int_t(1.33*fMarkerSize + 0.5);
   shape[0].SetX(-im);  shape[0].SetY( im4);
   shape[1].SetX(-im2); shape[1].SetY(-im1);
   shape[2].SetX(-im3); shape[2].SetY( -im);
   shape[3].SetX(  0);  shape[3].SetY(-im2);
   shape[4].SetX(im3);  shape[4].SetY( -im);
   shape[5].SetX(im2);  shape[5].SetY(-im1);
   shape[6].SetX( im);  shape[6].SetY( im4);
   shape[7].SetX(im4);  shape[7].SetY( im4);
   shape[8].SetX(  0);  shape[8].SetY( im);
   shape[9].SetX(-im4); shape[9].SetY( im4);
   //     shape[10].SetX(-im); shape[10].SetY( im4);
   SetMarkerType(3+penWidth,10,shape);
   break;
         }

case 30: {
   //*-*--- HIGZ open star pentagone
   Int_t im1 = Int_t(0.66*fMarkerSize + 0.5);
   Int_t im2 = Int_t(2.00*fMarkerSize + 0.5);
   Int_t im3 = Int_t(2.66*fMarkerSize + 0.5);
   Int_t im4 = Int_t(1.33*fMarkerSize + 0.5);
   shape[0].SetX(-im);  shape[0].SetY( im4);
   shape[1].SetX(-im2); shape[1].SetY(-im1);
   shape[2].SetX(-im3); shape[2].SetY( -im);
   shape[3].SetX(  0);  shape[3].SetY(-im2);
   shape[4].SetX(im3);  shape[4].SetY( -im);
   shape[5].SetX(im2);  shape[5].SetY(-im1);
   shape[6].SetX( im);  shape[6].SetY( im4);
   shape[7].SetX(im4);  shape[7].SetY( im4);
   shape[8].SetX(  0);  shape[8].SetY( im);
   shape[9].SetX(-im4); shape[9].SetY( im4);
   SetMarkerType(2+penWidth,10,shape);
   break;
         }

case 31:
   //*-*--- HIGZ +&&x (kind of star)
   SetMarkerType(1,im*2,shape);
   break;
default:
   //*-*--- single dot
   SetMarkerType(0+penWidth,0,shape);
   }
}

//______________________________________________________________________________
void  TGQt::SetMarkerType( int type, int n, TPoint *xy )
{
//*-*-*-*-*-*-*-*-*-*-*Set marker type*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ===============
//*-*  type      : marker type
//*-*  n         : length of marker description
//*-*  xy        : list of points describing marker shape
//*-*
//*-*     if N.EQ.0 marker is a single point
//*-*     if TYPE.EQ.0 marker is hollow circle of diameter N
//*-*     if TYPE.EQ.1 marker is filled circle of diameter N
//*-*     if TYPE.EQ.2 marker is a hollow polygon describe by line XY
//*-*     if TYPE.EQ.3 marker is a filled polygon describe by line XY
//*-*     if TYPE.EQ.4 marker is described by segmented line XY
//*-*     e.g. TYPE=4,N=4,XY=(-3,0,3,0,0,-3,0,3) sets a plus shape of 7x7 pixels
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     fQtMarker->SetMarker(n,xy,type);
}

//______________________________________________________________________________
int  TGQt::UpdateColor(int cindex)
{
   // [protected] update the color parameters if needed.
#define BIGGEST_RGB_VALUE 255  // 65535
   //  if (fSelectedWindow == NoOperation) return;
   if (cindex >= 0 ) {
      //    if (cindex >= fPallete.size()) fPallete.resize(cindex+1);
      //    fPallete[cindex].setRgb((r*BIGGEST_RGB_VALUE)
      if (!fPallete.contains(cindex)) {
         // qDebug() << "TGQt::UpdateRGB: Add the new index:" << cindex;
         fBlockRGB = kTRUE; // to eliminate a recursive setting via TGQt::SetRGB()
         TColor *rootColor = gROOT->GetColor(cindex);
         fBlockRGB = kFALSE;
         if (rootColor) {
             float r,g,b,a;
             rootColor->GetRGB(r,g,b);
             a= rootColor->GetAlpha();

             fPallete[cindex] =  new QColor(
                int(r*BIGGEST_RGB_VALUE+0.5)
               ,int(g*BIGGEST_RGB_VALUE+0.5)
               ,int(b*BIGGEST_RGB_VALUE+0.5)
               ,int(a*BIGGEST_RGB_VALUE+0.5)
            );
         }
      }
   }
   return cindex;
}
//______________________________________________________________________________
void  TGQt::SetRGB(int cindex, float r, float g, float b)
{
#define BIGGEST_RGB_VALUE 255  // 65535
   //  if (fSelectedWindow == NoOperation) return;
   if ( !fBlockRGB && cindex >= 0 ) {
      //    if (cindex >= fPallete.size()) fPallete.resize(cindex+1);
      //    fPallete[cindex].setRgb((r*BIGGEST_RGB_VALUE)
       // qDebug() << "TGQt::SetRGB: Add the new index: " << cindex;
       QMap<Color_t,QColor*>::iterator i = fPallete.find(cindex);
       if (i != fPallete.end()) {
          delete i.value();
          fPallete.erase(i);
       }
       fPallete[cindex] =  new QColor(
          int(r*BIGGEST_RGB_VALUE+0.5)
         ,int(g*BIGGEST_RGB_VALUE+0.5)
         ,int(b*BIGGEST_RGB_VALUE+0.5)
         );
   }
}
//______________________________________________________________________________
void  TGQt::SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b, Float_t a)
{
   // Set the color with the alpha component (supported wuth Qt 4 only)
   SetRGB(cindex, r, g,b);
   SetAlpha(cindex,a);
}
//______________________________________________________________________________
void  TGQt::SetAlpha(Int_t cindex, Float_t a)
{
   // Add  the alpha component (supported with Qt 4 only)
   if (cindex < 0 || a < 0 ) return;
   QColor *color = fPallete[cindex];
   if (color) color->setAlphaF(a);

}
//______________________________________________________________________________
void  TGQt::GetRGBA(Int_t cindex, Float_t &r, Float_t &g, Float_t &b, Float_t &a)
{
   // Return RGBA components for the color cindex
   GetRGB(cindex,r,g,b);
   a = GetAlpha(cindex);
}
//______________________________________________________________________________
Float_t TGQt::GetAlpha(Int_t cindex)
{
   // Return Alpha component for the color cindex
   if (cindex < 0 ) return 1.0;
   const QColor *color = fPallete[cindex];
   return (Float_t)color->alphaF();
}
//______________________________________________________________________________
void  TGQt::SetTextAlign(Short_t talign)
{
   //*-*-*-*-*-*-*-*-*-*-*Set text alignment*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  ==================
   //*-*  txalh   : horizontal text alignment
   //*-*  txalv   : vertical text alignment
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   Int_t txalh = talign/10;
   Int_t txalv = talign%10;

   fTextAlignH = txalh;
   fTextAlignV = txalv;

   fTextAlign = Qt::AlignLeft;
   switch( txalh ) {

  case 2:
     fTextAlign |= Qt::AlignHCenter;
     break;

  case 3:
     fTextAlign |= Qt::AlignRight;
     break;

  default:
     fTextAlign |= Qt::AlignLeft;
   }

   switch( txalv ) {

  case 1:
     fTextAlign |= Qt::AlignBottom;
     break;

  case 2:
     fTextAlign |= Qt::AlignVCenter;
     break;

  case 3:
     fTextAlign |= Qt::AlignTop;
     break;

  default:
     fTextAlign = Qt::AlignBottom;
   }
}

//______________________________________________________________________________
void  TGQt::SetTextColor(Color_t cindex)
{
   //*-*-*-*-*-*-*-*-*-*-*Set color index for text*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                  ========================
   //*-*  cindex    : color index defined my IXSETCOL
   //*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   if (fTextColor == cindex) return;
   fTextColor = UpdateColor(cindex);
   if (cindex < 0) return;
}

//______________________________________________________________________________
Int_t  TGQt::SetTextFont(char* /*fontname*/, TVirtualX::ETextSetMode /*mode*/)
{
   // Set text font to specified name.
   // mode       : loading flag
   // mode=kCheck = 0     : search if the font exist (kCheck)
   // mode= kLoad = 1     : search the font and load it if it exists (kLoad)
   // font       : font name
   //
   // Set text font to specified name. This function returns 0 if
   // the specified font is found, 1 if not.

   // Qt takes care to make sure the proper font is loaded and scaled.
   return 0;
}

//______________________________________________________________________________
void  TGQt::SetTextFont(Font_t fontnumber)
{
   //*-*-*-*-*-*-*-*-*-*-*-*-*Set current text font number*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                      ===========================
   //*-*  List of the currently supported fonts (screen and PostScript)
   //*-*  =============================================================
   //*-*   Font ID       X11                       Win32 TTF       lfItalic  lfWeight x 10
   //*-*        1 : times-medium-i-normal      "Times New Roman"      1           5
   //*-*        2 : times-bold-r-normal        "Times New Roman"      0           8
   //*-*        3 : times-bold-i-normal        "Times New Roman"      1           8
   //*-*        4 : helvetica-medium-r-normal  "Arial"                0           5
   //*-*        5 : helvetica-medium-o-normal  "Arial"                1           5
   //*-*        6 : helvetica-bold-r-normal    "Arial"                0           8
   //*-*        7 : helvetica-bold-o-normal    "Arial"                1           8
   //*-*        8 : courier-medium-r-normal    "Courier New"          0           5
   //*-*        9 : courier-medium-o-normal    "Courier New"          1           5
   //*-*       10 : courier-bold-r-normal      "Courier New"          0           8
   //*-*       11 : courier-bold-o-normal      "Courier New"          1           8
   //*-*       12 : symbol-medium-r-normal     "Symbol"               0           6
   //*-*       13 : times-medium-r-normal      "Times New Roman"      0           5
   //*-*       14 :                            "Wingdings"            0           5

   if ( fTextFont == fontnumber) return;
   fTextFont = fontnumber;
   if (fTextFont == -1) {
      fTextFontModified = 1;
      return;
   }
   fQFont->SetTextFont(fontnumber);
   fTextFontModified = 1;
}

//______________________________________________________________________________
void  TGQt::SetTextSize(Float_t textsize)
{
   //*-*-*-*-*-*-*-*-*-*-*-*-*Set current text size*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                      =====================
   if ( fTextSize != textsize ) {
      fTextSize = textsize;
      if (fTextSize > 0) {
         fQFont->SetTextSize(textsize);
         fTextFontModified = 1;
      }
   }
}

//______________________________________________________________________________
void  TGQt::SetTitle(const char *title)
{
   //*-*-*-*-*-*-*-*-*-*-*-*-*Set title of the object*-*-*-*-*-*-*-*-*-*-*-*-*-*
   //*-*                      =======================
   if (fSelectedWindow->devType() == QInternal::Widget)
   {
      ((TQtWidget *)fSelectedWindow)->topLevelWidget()-> setWindowTitle(GetTextDecoder()->toUnicode(title));
   }
}

//______________________________________________________________________________
void  TGQt::UpdateWindow(int mode)
{
   // Update display.
   // mode : (1) update
   //        (0) sync

   if (fSelectedWindow && mode != 2 ) {
      ((TQtWidget *)fSelectedWindow)->paintFlag();
      ((TQtWidget *)fSelectedWindow)->repaint();
#ifndef R__WIN32
      // X11 needs "repaint" operation to be forced by some reason
//      qDebug() <<  " TGQt::UpdateWindow " 
//               <<  " Please check whether the \"" 
//               <<  "QCoreApplication::processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers, 200);"
//               << "\" still needed !!!";
#endif
   }
}

//______________________________________________________________________________
Int_t  TGQt::WriteGIF(char *name)
{
   //
   // Writes the current active window into pixmap file.
   // The format is defined by the file name extension
   // like "png","jpg","bmp"  . . .
   // If no extension is provided the "png" format is used by default
   //
   // Returns 1 in case of success,
   //         0 otherwise
   // Note: this method may not produce the expected result been called
   // ----  from the ROOT prompt by simple reason:
   //       The active window will be console window
   //       rather the last selected ROOT canvas.
   //
   WritePixmap(iwid(fSelectedWindow),UInt_t(-1),UInt_t(-1),name);
   return kTRUE;
}

//______________________________________________________________________________
void  TGQt::WritePixmap(int wd, UInt_t w, UInt_t h, char *pxname)
{
   // Write the pixmap wd in the bitmap file pxname in JPEG.
   // wd         : Pixmap address
   // w,h         : Width and height of the pixmap.
   //               if w = h = -1 the size of the pimxap is equal the size the wd size
   // pxname      : pixmap file name
   //               The format is defined by the file name extension
   //               like "png","jpg","bmp"  . . .
   //               If no or some unknown extension is provided then
   //               the "png" format is used by default
   // --
   // Take in account the special ROOT filename syntax 26.12.2006 vf
   //               "gif+NN" - an animated GIF file is produced, where NN is delay in 10ms units

   if (!wd || (wd == -1) ) return;

   QPaintDevice &dev = *iwid(wd);
   QPixmap grabWidget;
   QPixmap *pix=0;
   switch (dev.devType()) {
   case QInternal::Widget: {
        TQtWidget *thisWidget = (TQtWidget*)&dev;
        if (thisWidget->IsDoubleBuffered() ) {
           pix = ((const TQtWidget*)&dev)->GetOffScreenBuffer();
        } else {
           // Grab the widget rectangle area directly from the screen
           // The image may contain the "alien" pieces !
           grabWidget = QPixmap::grabWindow(thisWidget->winId());
           pix = &grabWidget;
        }
     }
     break;

   case QInternal::Pixmap: {
      pix = (QPixmap *)&dev;
      break;
                          }
   case QInternal::Picture:
   case QInternal::Printer:
   default: assert(0);
     break;
   };
   if (pix) {
      // Create intermediate pixmap to stretch the original one if any
      QPixmap *finalPixmap = 0;
      if ( ( (h == w) && (w == UInt_t(-1) ) ) || ( QSize(w,h) == pix->size()) ) {
         finalPixmap = new QPixmap(*pix);
      }  else  {
         finalPixmap = new QPixmap(pix->scaled(w,h));
      }
      // Detect the special case "gif+"
      QString fname = pxname;
      int plus = fname.indexOf("+");
      if (plus>=0) fname = fname.left(plus);

      //  define the file extension
      QString saveType = QtFileFormat(QFileInfo(fname).suffix());
      //Info("WritePixmap"," type %s name = %s plus =  %d\n", (const char *)saveType,
      //   (const char*) fname, plus);
      if (saveType.isEmpty()) saveType="PNG";

      else if (QFileInfo(fname).suffix() == "gif") {
         // TrollTech doesn't allow the  GIF writting due
         // the patent problem.
         Int_t saver = gErrorIgnoreLevel;
         gErrorIgnoreLevel = kFatal;
         TImage *img = TImage::Create();
         if (img) {
            img->SetImage(Pixmap_t(rootwid(finalPixmap)),0);
            img->WriteImage(pxname,
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,13,0)
                  plus>=0 ? TImage::kAnimGif: TImage::kGif);
#else
                  TImage::kGif);
#endif
            delete img;
         }
         gErrorIgnoreLevel = saver;
      } else {
         if (plus>=0) fname = GetNewFileName(fname);
         finalPixmap->save(fname,saveType.toAscii().data());
      }
      delete finalPixmap;
   }
}

//______________________________________________________________________________
TVirtualX *TGQt::GetVirtualX(){ return fgTQt;}

//______________________________________________________________________________
Int_t TGQt::LoadQt(const char *shareLibFileName)
{
   // Make sure we load the GUI DLL from the gui thread
   return gSystem->Load(shareLibFileName);
}

//______________________________________________________________________________
Int_t TGQt::processQtEvents(Int_t maxtime)
{
   // Force processing the Qt events only without entering the ROOT event loop
   QCoreApplication::processEvents(QEventLoop::AllEvents,maxtime);
   // QEventLoop::ExcludeUserInput QEventLoop::ExcludeSocketNotifiers
   return 0;
 }
 TGQt.cxx:1
 TGQt.cxx:2
 TGQt.cxx:3
 TGQt.cxx:4
 TGQt.cxx:5
 TGQt.cxx:6
 TGQt.cxx:7
 TGQt.cxx:8
 TGQt.cxx:9
 TGQt.cxx:10
 TGQt.cxx:11
 TGQt.cxx:12
 TGQt.cxx:13
 TGQt.cxx:14
 TGQt.cxx:15
 TGQt.cxx:16
 TGQt.cxx:17
 TGQt.cxx:18
 TGQt.cxx:19
 TGQt.cxx:20
 TGQt.cxx:21
 TGQt.cxx:22
 TGQt.cxx:23
 TGQt.cxx:24
 TGQt.cxx:25
 TGQt.cxx:26
 TGQt.cxx:27
 TGQt.cxx:28
 TGQt.cxx:29
 TGQt.cxx:30
 TGQt.cxx:31
 TGQt.cxx:32
 TGQt.cxx:33
 TGQt.cxx:34
 TGQt.cxx:35
 TGQt.cxx:36
 TGQt.cxx:37
 TGQt.cxx:38
 TGQt.cxx:39
 TGQt.cxx:40
 TGQt.cxx:41
 TGQt.cxx:42
 TGQt.cxx:43
 TGQt.cxx:44
 TGQt.cxx:45
 TGQt.cxx:46
 TGQt.cxx:47
 TGQt.cxx:48
 TGQt.cxx:49
 TGQt.cxx:50
 TGQt.cxx:51
 TGQt.cxx:52
 TGQt.cxx:53
 TGQt.cxx:54
 TGQt.cxx:55
 TGQt.cxx:56
 TGQt.cxx:57
 TGQt.cxx:58
 TGQt.cxx:59
 TGQt.cxx:60
 TGQt.cxx:61
 TGQt.cxx:62
 TGQt.cxx:63
 TGQt.cxx:64
 TGQt.cxx:65
 TGQt.cxx:66
 TGQt.cxx:67
 TGQt.cxx:68
 TGQt.cxx:69
 TGQt.cxx:70
 TGQt.cxx:71
 TGQt.cxx:72
 TGQt.cxx:73
 TGQt.cxx:74
 TGQt.cxx:75
 TGQt.cxx:76
 TGQt.cxx:77
 TGQt.cxx:78
 TGQt.cxx:79
 TGQt.cxx:80
 TGQt.cxx:81
 TGQt.cxx:82
 TGQt.cxx:83
 TGQt.cxx:84
 TGQt.cxx:85
 TGQt.cxx:86
 TGQt.cxx:87
 TGQt.cxx:88
 TGQt.cxx:89
 TGQt.cxx:90
 TGQt.cxx:91
 TGQt.cxx:92
 TGQt.cxx:93
 TGQt.cxx:94
 TGQt.cxx:95
 TGQt.cxx:96
 TGQt.cxx:97
 TGQt.cxx:98
 TGQt.cxx:99
 TGQt.cxx:100
 TGQt.cxx:101
 TGQt.cxx:102
 TGQt.cxx:103
 TGQt.cxx:104
 TGQt.cxx:105
 TGQt.cxx:106
 TGQt.cxx:107
 TGQt.cxx:108
 TGQt.cxx:109
 TGQt.cxx:110
 TGQt.cxx:111
 TGQt.cxx:112
 TGQt.cxx:113
 TGQt.cxx:114
 TGQt.cxx:115
 TGQt.cxx:116
 TGQt.cxx:117
 TGQt.cxx:118
 TGQt.cxx:119
 TGQt.cxx:120
 TGQt.cxx:121
 TGQt.cxx:122
 TGQt.cxx:123
 TGQt.cxx:124
 TGQt.cxx:125
 TGQt.cxx:126
 TGQt.cxx:127
 TGQt.cxx:128
 TGQt.cxx:129
 TGQt.cxx:130
 TGQt.cxx:131
 TGQt.cxx:132
 TGQt.cxx:133
 TGQt.cxx:134
 TGQt.cxx:135
 TGQt.cxx:136
 TGQt.cxx:137
 TGQt.cxx:138
 TGQt.cxx:139
 TGQt.cxx:140
 TGQt.cxx:141
 TGQt.cxx:142
 TGQt.cxx:143
 TGQt.cxx:144
 TGQt.cxx:145
 TGQt.cxx:146
 TGQt.cxx:147
 TGQt.cxx:148
 TGQt.cxx:149
 TGQt.cxx:150
 TGQt.cxx:151
 TGQt.cxx:152
 TGQt.cxx:153
 TGQt.cxx:154
 TGQt.cxx:155
 TGQt.cxx:156
 TGQt.cxx:157
 TGQt.cxx:158
 TGQt.cxx:159
 TGQt.cxx:160
 TGQt.cxx:161
 TGQt.cxx:162
 TGQt.cxx:163
 TGQt.cxx:164
 TGQt.cxx:165
 TGQt.cxx:166
 TGQt.cxx:167
 TGQt.cxx:168
 TGQt.cxx:169
 TGQt.cxx:170
 TGQt.cxx:171
 TGQt.cxx:172
 TGQt.cxx:173
 TGQt.cxx:174
 TGQt.cxx:175
 TGQt.cxx:176
 TGQt.cxx:177
 TGQt.cxx:178
 TGQt.cxx:179
 TGQt.cxx:180
 TGQt.cxx:181
 TGQt.cxx:182
 TGQt.cxx:183
 TGQt.cxx:184
 TGQt.cxx:185
 TGQt.cxx:186
 TGQt.cxx:187
 TGQt.cxx:188
 TGQt.cxx:189
 TGQt.cxx:190
 TGQt.cxx:191
 TGQt.cxx:192
 TGQt.cxx:193
 TGQt.cxx:194
 TGQt.cxx:195
 TGQt.cxx:196
 TGQt.cxx:197
 TGQt.cxx:198
 TGQt.cxx:199
 TGQt.cxx:200
 TGQt.cxx:201
 TGQt.cxx:202
 TGQt.cxx:203
 TGQt.cxx:204
 TGQt.cxx:205
 TGQt.cxx:206
 TGQt.cxx:207
 TGQt.cxx:208
 TGQt.cxx:209
 TGQt.cxx:210
 TGQt.cxx:211
 TGQt.cxx:212
 TGQt.cxx:213
 TGQt.cxx:214
 TGQt.cxx:215
 TGQt.cxx:216
 TGQt.cxx:217
 TGQt.cxx:218
 TGQt.cxx:219
 TGQt.cxx:220
 TGQt.cxx:221
 TGQt.cxx:222
 TGQt.cxx:223
 TGQt.cxx:224
 TGQt.cxx:225
 TGQt.cxx:226
 TGQt.cxx:227
 TGQt.cxx:228
 TGQt.cxx:229
 TGQt.cxx:230
 TGQt.cxx:231
 TGQt.cxx:232
 TGQt.cxx:233
 TGQt.cxx:234
 TGQt.cxx:235
 TGQt.cxx:236
 TGQt.cxx:237
 TGQt.cxx:238
 TGQt.cxx:239
 TGQt.cxx:240
 TGQt.cxx:241
 TGQt.cxx:242
 TGQt.cxx:243
 TGQt.cxx:244
 TGQt.cxx:245
 TGQt.cxx:246
 TGQt.cxx:247
 TGQt.cxx:248
 TGQt.cxx:249
 TGQt.cxx:250
 TGQt.cxx:251
 TGQt.cxx:252
 TGQt.cxx:253
 TGQt.cxx:254
 TGQt.cxx:255
 TGQt.cxx:256
 TGQt.cxx:257
 TGQt.cxx:258
 TGQt.cxx:259
 TGQt.cxx:260
 TGQt.cxx:261
 TGQt.cxx:262
 TGQt.cxx:263
 TGQt.cxx:264
 TGQt.cxx:265
 TGQt.cxx:266
 TGQt.cxx:267
 TGQt.cxx:268
 TGQt.cxx:269
 TGQt.cxx:270
 TGQt.cxx:271
 TGQt.cxx:272
 TGQt.cxx:273
 TGQt.cxx:274
 TGQt.cxx:275
 TGQt.cxx:276
 TGQt.cxx:277
 TGQt.cxx:278
 TGQt.cxx:279
 TGQt.cxx:280
 TGQt.cxx:281
 TGQt.cxx:282
 TGQt.cxx:283
 TGQt.cxx:284
 TGQt.cxx:285
 TGQt.cxx:286
 TGQt.cxx:287
 TGQt.cxx:288
 TGQt.cxx:289
 TGQt.cxx:290
 TGQt.cxx:291
 TGQt.cxx:292
 TGQt.cxx:293
 TGQt.cxx:294
 TGQt.cxx:295
 TGQt.cxx:296
 TGQt.cxx:297
 TGQt.cxx:298
 TGQt.cxx:299
 TGQt.cxx:300
 TGQt.cxx:301
 TGQt.cxx:302
 TGQt.cxx:303
 TGQt.cxx:304
 TGQt.cxx:305
 TGQt.cxx:306
 TGQt.cxx:307
 TGQt.cxx:308
 TGQt.cxx:309
 TGQt.cxx:310
 TGQt.cxx:311
 TGQt.cxx:312
 TGQt.cxx:313
 TGQt.cxx:314
 TGQt.cxx:315
 TGQt.cxx:316
 TGQt.cxx:317
 TGQt.cxx:318
 TGQt.cxx:319
 TGQt.cxx:320
 TGQt.cxx:321
 TGQt.cxx:322
 TGQt.cxx:323
 TGQt.cxx:324
 TGQt.cxx:325
 TGQt.cxx:326
 TGQt.cxx:327
 TGQt.cxx:328
 TGQt.cxx:329
 TGQt.cxx:330
 TGQt.cxx:331
 TGQt.cxx:332
 TGQt.cxx:333
 TGQt.cxx:334
 TGQt.cxx:335
 TGQt.cxx:336
 TGQt.cxx:337
 TGQt.cxx:338
 TGQt.cxx:339
 TGQt.cxx:340
 TGQt.cxx:341
 TGQt.cxx:342
 TGQt.cxx:343
 TGQt.cxx:344
 TGQt.cxx:345
 TGQt.cxx:346
 TGQt.cxx:347
 TGQt.cxx:348
 TGQt.cxx:349
 TGQt.cxx:350
 TGQt.cxx:351
 TGQt.cxx:352
 TGQt.cxx:353
 TGQt.cxx:354
 TGQt.cxx:355
 TGQt.cxx:356
 TGQt.cxx:357
 TGQt.cxx:358
 TGQt.cxx:359
 TGQt.cxx:360
 TGQt.cxx:361
 TGQt.cxx:362
 TGQt.cxx:363
 TGQt.cxx:364
 TGQt.cxx:365
 TGQt.cxx:366
 TGQt.cxx:367
 TGQt.cxx:368
 TGQt.cxx:369
 TGQt.cxx:370
 TGQt.cxx:371
 TGQt.cxx:372
 TGQt.cxx:373
 TGQt.cxx:374
 TGQt.cxx:375
 TGQt.cxx:376
 TGQt.cxx:377
 TGQt.cxx:378
 TGQt.cxx:379
 TGQt.cxx:380
 TGQt.cxx:381
 TGQt.cxx:382
 TGQt.cxx:383
 TGQt.cxx:384
 TGQt.cxx:385
 TGQt.cxx:386
 TGQt.cxx:387
 TGQt.cxx:388
 TGQt.cxx:389
 TGQt.cxx:390
 TGQt.cxx:391
 TGQt.cxx:392
 TGQt.cxx:393
 TGQt.cxx:394
 TGQt.cxx:395
 TGQt.cxx:396
 TGQt.cxx:397
 TGQt.cxx:398
 TGQt.cxx:399
 TGQt.cxx:400
 TGQt.cxx:401
 TGQt.cxx:402
 TGQt.cxx:403
 TGQt.cxx:404
 TGQt.cxx:405
 TGQt.cxx:406
 TGQt.cxx:407
 TGQt.cxx:408
 TGQt.cxx:409
 TGQt.cxx:410
 TGQt.cxx:411
 TGQt.cxx:412
 TGQt.cxx:413
 TGQt.cxx:414
 TGQt.cxx:415
 TGQt.cxx:416
 TGQt.cxx:417
 TGQt.cxx:418
 TGQt.cxx:419
 TGQt.cxx:420
 TGQt.cxx:421
 TGQt.cxx:422
 TGQt.cxx:423
 TGQt.cxx:424
 TGQt.cxx:425
 TGQt.cxx:426
 TGQt.cxx:427
 TGQt.cxx:428
 TGQt.cxx:429
 TGQt.cxx:430
 TGQt.cxx:431
 TGQt.cxx:432
 TGQt.cxx:433
 TGQt.cxx:434
 TGQt.cxx:435
 TGQt.cxx:436
 TGQt.cxx:437
 TGQt.cxx:438
 TGQt.cxx:439
 TGQt.cxx:440
 TGQt.cxx:441
 TGQt.cxx:442
 TGQt.cxx:443
 TGQt.cxx:444
 TGQt.cxx:445
 TGQt.cxx:446
 TGQt.cxx:447
 TGQt.cxx:448
 TGQt.cxx:449
 TGQt.cxx:450
 TGQt.cxx:451
 TGQt.cxx:452
 TGQt.cxx:453
 TGQt.cxx:454
 TGQt.cxx:455
 TGQt.cxx:456
 TGQt.cxx:457
 TGQt.cxx:458
 TGQt.cxx:459
 TGQt.cxx:460
 TGQt.cxx:461
 TGQt.cxx:462
 TGQt.cxx:463
 TGQt.cxx:464
 TGQt.cxx:465
 TGQt.cxx:466
 TGQt.cxx:467
 TGQt.cxx:468
 TGQt.cxx:469
 TGQt.cxx:470
 TGQt.cxx:471
 TGQt.cxx:472
 TGQt.cxx:473
 TGQt.cxx:474
 TGQt.cxx:475
 TGQt.cxx:476
 TGQt.cxx:477
 TGQt.cxx:478
 TGQt.cxx:479
 TGQt.cxx:480
 TGQt.cxx:481
 TGQt.cxx:482
 TGQt.cxx:483
 TGQt.cxx:484
 TGQt.cxx:485
 TGQt.cxx:486
 TGQt.cxx:487
 TGQt.cxx:488
 TGQt.cxx:489
 TGQt.cxx:490
 TGQt.cxx:491
 TGQt.cxx:492
 TGQt.cxx:493
 TGQt.cxx:494
 TGQt.cxx:495
 TGQt.cxx:496
 TGQt.cxx:497
 TGQt.cxx:498
 TGQt.cxx:499
 TGQt.cxx:500
 TGQt.cxx:501
 TGQt.cxx:502
 TGQt.cxx:503
 TGQt.cxx:504
 TGQt.cxx:505
 TGQt.cxx:506
 TGQt.cxx:507
 TGQt.cxx:508
 TGQt.cxx:509
 TGQt.cxx:510
 TGQt.cxx:511
 TGQt.cxx:512
 TGQt.cxx:513
 TGQt.cxx:514
 TGQt.cxx:515
 TGQt.cxx:516
 TGQt.cxx:517
 TGQt.cxx:518
 TGQt.cxx:519
 TGQt.cxx:520
 TGQt.cxx:521
 TGQt.cxx:522
 TGQt.cxx:523
 TGQt.cxx:524
 TGQt.cxx:525
 TGQt.cxx:526
 TGQt.cxx:527
 TGQt.cxx:528
 TGQt.cxx:529
 TGQt.cxx:530
 TGQt.cxx:531
 TGQt.cxx:532
 TGQt.cxx:533
 TGQt.cxx:534
 TGQt.cxx:535
 TGQt.cxx:536
 TGQt.cxx:537
 TGQt.cxx:538
 TGQt.cxx:539
 TGQt.cxx:540
 TGQt.cxx:541
 TGQt.cxx:542
 TGQt.cxx:543
 TGQt.cxx:544
 TGQt.cxx:545
 TGQt.cxx:546
 TGQt.cxx:547
 TGQt.cxx:548
 TGQt.cxx:549
 TGQt.cxx:550
 TGQt.cxx:551
 TGQt.cxx:552
 TGQt.cxx:553
 TGQt.cxx:554
 TGQt.cxx:555
 TGQt.cxx:556
 TGQt.cxx:557
 TGQt.cxx:558
 TGQt.cxx:559
 TGQt.cxx:560
 TGQt.cxx:561
 TGQt.cxx:562
 TGQt.cxx:563
 TGQt.cxx:564
 TGQt.cxx:565
 TGQt.cxx:566
 TGQt.cxx:567
 TGQt.cxx:568
 TGQt.cxx:569
 TGQt.cxx:570
 TGQt.cxx:571
 TGQt.cxx:572
 TGQt.cxx:573
 TGQt.cxx:574
 TGQt.cxx:575
 TGQt.cxx:576
 TGQt.cxx:577
 TGQt.cxx:578
 TGQt.cxx:579
 TGQt.cxx:580
 TGQt.cxx:581
 TGQt.cxx:582
 TGQt.cxx:583
 TGQt.cxx:584
 TGQt.cxx:585
 TGQt.cxx:586
 TGQt.cxx:587
 TGQt.cxx:588
 TGQt.cxx:589
 TGQt.cxx:590
 TGQt.cxx:591
 TGQt.cxx:592
 TGQt.cxx:593
 TGQt.cxx:594
 TGQt.cxx:595
 TGQt.cxx:596
 TGQt.cxx:597
 TGQt.cxx:598
 TGQt.cxx:599
 TGQt.cxx:600
 TGQt.cxx:601
 TGQt.cxx:602
 TGQt.cxx:603
 TGQt.cxx:604
 TGQt.cxx:605
 TGQt.cxx:606
 TGQt.cxx:607
 TGQt.cxx:608
 TGQt.cxx:609
 TGQt.cxx:610
 TGQt.cxx:611
 TGQt.cxx:612
 TGQt.cxx:613
 TGQt.cxx:614
 TGQt.cxx:615
 TGQt.cxx:616
 TGQt.cxx:617
 TGQt.cxx:618
 TGQt.cxx:619
 TGQt.cxx:620
 TGQt.cxx:621
 TGQt.cxx:622
 TGQt.cxx:623
 TGQt.cxx:624
 TGQt.cxx:625
 TGQt.cxx:626
 TGQt.cxx:627
 TGQt.cxx:628
 TGQt.cxx:629
 TGQt.cxx:630
 TGQt.cxx:631
 TGQt.cxx:632
 TGQt.cxx:633
 TGQt.cxx:634
 TGQt.cxx:635
 TGQt.cxx:636
 TGQt.cxx:637
 TGQt.cxx:638
 TGQt.cxx:639
 TGQt.cxx:640
 TGQt.cxx:641
 TGQt.cxx:642
 TGQt.cxx:643
 TGQt.cxx:644
 TGQt.cxx:645
 TGQt.cxx:646
 TGQt.cxx:647
 TGQt.cxx:648
 TGQt.cxx:649
 TGQt.cxx:650
 TGQt.cxx:651
 TGQt.cxx:652
 TGQt.cxx:653
 TGQt.cxx:654
 TGQt.cxx:655
 TGQt.cxx:656
 TGQt.cxx:657
 TGQt.cxx:658
 TGQt.cxx:659
 TGQt.cxx:660
 TGQt.cxx:661
 TGQt.cxx:662
 TGQt.cxx:663
 TGQt.cxx:664
 TGQt.cxx:665
 TGQt.cxx:666
 TGQt.cxx:667
 TGQt.cxx:668
 TGQt.cxx:669
 TGQt.cxx:670
 TGQt.cxx:671
 TGQt.cxx:672
 TGQt.cxx:673
 TGQt.cxx:674
 TGQt.cxx:675
 TGQt.cxx:676
 TGQt.cxx:677
 TGQt.cxx:678
 TGQt.cxx:679
 TGQt.cxx:680
 TGQt.cxx:681
 TGQt.cxx:682
 TGQt.cxx:683
 TGQt.cxx:684
 TGQt.cxx:685
 TGQt.cxx:686
 TGQt.cxx:687
 TGQt.cxx:688
 TGQt.cxx:689
 TGQt.cxx:690
 TGQt.cxx:691
 TGQt.cxx:692
 TGQt.cxx:693
 TGQt.cxx:694
 TGQt.cxx:695
 TGQt.cxx:696
 TGQt.cxx:697
 TGQt.cxx:698
 TGQt.cxx:699
 TGQt.cxx:700
 TGQt.cxx:701
 TGQt.cxx:702
 TGQt.cxx:703
 TGQt.cxx:704
 TGQt.cxx:705
 TGQt.cxx:706
 TGQt.cxx:707
 TGQt.cxx:708
 TGQt.cxx:709
 TGQt.cxx:710
 TGQt.cxx:711
 TGQt.cxx:712
 TGQt.cxx:713
 TGQt.cxx:714
 TGQt.cxx:715
 TGQt.cxx:716
 TGQt.cxx:717
 TGQt.cxx:718
 TGQt.cxx:719
 TGQt.cxx:720
 TGQt.cxx:721
 TGQt.cxx:722
 TGQt.cxx:723
 TGQt.cxx:724
 TGQt.cxx:725
 TGQt.cxx:726
 TGQt.cxx:727
 TGQt.cxx:728
 TGQt.cxx:729
 TGQt.cxx:730
 TGQt.cxx:731
 TGQt.cxx:732
 TGQt.cxx:733
 TGQt.cxx:734
 TGQt.cxx:735
 TGQt.cxx:736
 TGQt.cxx:737
 TGQt.cxx:738
 TGQt.cxx:739
 TGQt.cxx:740
 TGQt.cxx:741
 TGQt.cxx:742
 TGQt.cxx:743
 TGQt.cxx:744
 TGQt.cxx:745
 TGQt.cxx:746
 TGQt.cxx:747
 TGQt.cxx:748
 TGQt.cxx:749
 TGQt.cxx:750
 TGQt.cxx:751
 TGQt.cxx:752
 TGQt.cxx:753
 TGQt.cxx:754
 TGQt.cxx:755
 TGQt.cxx:756
 TGQt.cxx:757
 TGQt.cxx:758
 TGQt.cxx:759
 TGQt.cxx:760
 TGQt.cxx:761
 TGQt.cxx:762
 TGQt.cxx:763
 TGQt.cxx:764
 TGQt.cxx:765
 TGQt.cxx:766
 TGQt.cxx:767
 TGQt.cxx:768
 TGQt.cxx:769
 TGQt.cxx:770
 TGQt.cxx:771
 TGQt.cxx:772
 TGQt.cxx:773
 TGQt.cxx:774
 TGQt.cxx:775
 TGQt.cxx:776
 TGQt.cxx:777
 TGQt.cxx:778
 TGQt.cxx:779
 TGQt.cxx:780
 TGQt.cxx:781
 TGQt.cxx:782
 TGQt.cxx:783
 TGQt.cxx:784
 TGQt.cxx:785
 TGQt.cxx:786
 TGQt.cxx:787
 TGQt.cxx:788
 TGQt.cxx:789
 TGQt.cxx:790
 TGQt.cxx:791
 TGQt.cxx:792
 TGQt.cxx:793
 TGQt.cxx:794
 TGQt.cxx:795
 TGQt.cxx:796
 TGQt.cxx:797
 TGQt.cxx:798
 TGQt.cxx:799
 TGQt.cxx:800
 TGQt.cxx:801
 TGQt.cxx:802
 TGQt.cxx:803
 TGQt.cxx:804
 TGQt.cxx:805
 TGQt.cxx:806
 TGQt.cxx:807
 TGQt.cxx:808
 TGQt.cxx:809
 TGQt.cxx:810
 TGQt.cxx:811
 TGQt.cxx:812
 TGQt.cxx:813
 TGQt.cxx:814
 TGQt.cxx:815
 TGQt.cxx:816
 TGQt.cxx:817
 TGQt.cxx:818
 TGQt.cxx:819
 TGQt.cxx:820
 TGQt.cxx:821
 TGQt.cxx:822
 TGQt.cxx:823
 TGQt.cxx:824
 TGQt.cxx:825
 TGQt.cxx:826
 TGQt.cxx:827
 TGQt.cxx:828
 TGQt.cxx:829
 TGQt.cxx:830
 TGQt.cxx:831
 TGQt.cxx:832
 TGQt.cxx:833
 TGQt.cxx:834
 TGQt.cxx:835
 TGQt.cxx:836
 TGQt.cxx:837
 TGQt.cxx:838
 TGQt.cxx:839
 TGQt.cxx:840
 TGQt.cxx:841
 TGQt.cxx:842
 TGQt.cxx:843
 TGQt.cxx:844
 TGQt.cxx:845
 TGQt.cxx:846
 TGQt.cxx:847
 TGQt.cxx:848
 TGQt.cxx:849
 TGQt.cxx:850
 TGQt.cxx:851
 TGQt.cxx:852
 TGQt.cxx:853
 TGQt.cxx:854
 TGQt.cxx:855
 TGQt.cxx:856
 TGQt.cxx:857
 TGQt.cxx:858
 TGQt.cxx:859
 TGQt.cxx:860
 TGQt.cxx:861
 TGQt.cxx:862
 TGQt.cxx:863
 TGQt.cxx:864
 TGQt.cxx:865
 TGQt.cxx:866
 TGQt.cxx:867
 TGQt.cxx:868
 TGQt.cxx:869
 TGQt.cxx:870
 TGQt.cxx:871
 TGQt.cxx:872
 TGQt.cxx:873
 TGQt.cxx:874
 TGQt.cxx:875
 TGQt.cxx:876
 TGQt.cxx:877
 TGQt.cxx:878
 TGQt.cxx:879
 TGQt.cxx:880
 TGQt.cxx:881
 TGQt.cxx:882
 TGQt.cxx:883
 TGQt.cxx:884
 TGQt.cxx:885
 TGQt.cxx:886
 TGQt.cxx:887
 TGQt.cxx:888
 TGQt.cxx:889
 TGQt.cxx:890
 TGQt.cxx:891
 TGQt.cxx:892
 TGQt.cxx:893
 TGQt.cxx:894
 TGQt.cxx:895
 TGQt.cxx:896
 TGQt.cxx:897
 TGQt.cxx:898
 TGQt.cxx:899
 TGQt.cxx:900
 TGQt.cxx:901
 TGQt.cxx:902
 TGQt.cxx:903
 TGQt.cxx:904
 TGQt.cxx:905
 TGQt.cxx:906
 TGQt.cxx:907
 TGQt.cxx:908
 TGQt.cxx:909
 TGQt.cxx:910
 TGQt.cxx:911
 TGQt.cxx:912
 TGQt.cxx:913
 TGQt.cxx:914
 TGQt.cxx:915
 TGQt.cxx:916
 TGQt.cxx:917
 TGQt.cxx:918
 TGQt.cxx:919
 TGQt.cxx:920
 TGQt.cxx:921
 TGQt.cxx:922
 TGQt.cxx:923
 TGQt.cxx:924
 TGQt.cxx:925
 TGQt.cxx:926
 TGQt.cxx:927
 TGQt.cxx:928
 TGQt.cxx:929
 TGQt.cxx:930
 TGQt.cxx:931
 TGQt.cxx:932
 TGQt.cxx:933
 TGQt.cxx:934
 TGQt.cxx:935
 TGQt.cxx:936
 TGQt.cxx:937
 TGQt.cxx:938
 TGQt.cxx:939
 TGQt.cxx:940
 TGQt.cxx:941
 TGQt.cxx:942
 TGQt.cxx:943
 TGQt.cxx:944
 TGQt.cxx:945
 TGQt.cxx:946
 TGQt.cxx:947
 TGQt.cxx:948
 TGQt.cxx:949
 TGQt.cxx:950
 TGQt.cxx:951
 TGQt.cxx:952
 TGQt.cxx:953
 TGQt.cxx:954
 TGQt.cxx:955
 TGQt.cxx:956
 TGQt.cxx:957
 TGQt.cxx:958
 TGQt.cxx:959
 TGQt.cxx:960
 TGQt.cxx:961
 TGQt.cxx:962
 TGQt.cxx:963
 TGQt.cxx:964
 TGQt.cxx:965
 TGQt.cxx:966
 TGQt.cxx:967
 TGQt.cxx:968
 TGQt.cxx:969
 TGQt.cxx:970
 TGQt.cxx:971
 TGQt.cxx:972
 TGQt.cxx:973
 TGQt.cxx:974
 TGQt.cxx:975
 TGQt.cxx:976
 TGQt.cxx:977
 TGQt.cxx:978
 TGQt.cxx:979
 TGQt.cxx:980
 TGQt.cxx:981
 TGQt.cxx:982
 TGQt.cxx:983
 TGQt.cxx:984
 TGQt.cxx:985
 TGQt.cxx:986
 TGQt.cxx:987
 TGQt.cxx:988
 TGQt.cxx:989
 TGQt.cxx:990
 TGQt.cxx:991
 TGQt.cxx:992
 TGQt.cxx:993
 TGQt.cxx:994
 TGQt.cxx:995
 TGQt.cxx:996
 TGQt.cxx:997
 TGQt.cxx:998
 TGQt.cxx:999
 TGQt.cxx:1000
 TGQt.cxx:1001
 TGQt.cxx:1002
 TGQt.cxx:1003
 TGQt.cxx:1004
 TGQt.cxx:1005
 TGQt.cxx:1006
 TGQt.cxx:1007
 TGQt.cxx:1008
 TGQt.cxx:1009
 TGQt.cxx:1010
 TGQt.cxx:1011
 TGQt.cxx:1012
 TGQt.cxx:1013
 TGQt.cxx:1014
 TGQt.cxx:1015
 TGQt.cxx:1016
 TGQt.cxx:1017
 TGQt.cxx:1018
 TGQt.cxx:1019
 TGQt.cxx:1020
 TGQt.cxx:1021
 TGQt.cxx:1022
 TGQt.cxx:1023
 TGQt.cxx:1024
 TGQt.cxx:1025
 TGQt.cxx:1026
 TGQt.cxx:1027
 TGQt.cxx:1028
 TGQt.cxx:1029
 TGQt.cxx:1030
 TGQt.cxx:1031
 TGQt.cxx:1032
 TGQt.cxx:1033
 TGQt.cxx:1034
 TGQt.cxx:1035
 TGQt.cxx:1036
 TGQt.cxx:1037
 TGQt.cxx:1038
 TGQt.cxx:1039
 TGQt.cxx:1040
 TGQt.cxx:1041
 TGQt.cxx:1042
 TGQt.cxx:1043
 TGQt.cxx:1044
 TGQt.cxx:1045
 TGQt.cxx:1046
 TGQt.cxx:1047
 TGQt.cxx:1048
 TGQt.cxx:1049
 TGQt.cxx:1050
 TGQt.cxx:1051
 TGQt.cxx:1052
 TGQt.cxx:1053
 TGQt.cxx:1054
 TGQt.cxx:1055
 TGQt.cxx:1056
 TGQt.cxx:1057
 TGQt.cxx:1058
 TGQt.cxx:1059
 TGQt.cxx:1060
 TGQt.cxx:1061
 TGQt.cxx:1062
 TGQt.cxx:1063
 TGQt.cxx:1064
 TGQt.cxx:1065
 TGQt.cxx:1066
 TGQt.cxx:1067
 TGQt.cxx:1068
 TGQt.cxx:1069
 TGQt.cxx:1070
 TGQt.cxx:1071
 TGQt.cxx:1072
 TGQt.cxx:1073
 TGQt.cxx:1074
 TGQt.cxx:1075
 TGQt.cxx:1076
 TGQt.cxx:1077
 TGQt.cxx:1078
 TGQt.cxx:1079
 TGQt.cxx:1080
 TGQt.cxx:1081
 TGQt.cxx:1082
 TGQt.cxx:1083
 TGQt.cxx:1084
 TGQt.cxx:1085
 TGQt.cxx:1086
 TGQt.cxx:1087
 TGQt.cxx:1088
 TGQt.cxx:1089
 TGQt.cxx:1090
 TGQt.cxx:1091
 TGQt.cxx:1092
 TGQt.cxx:1093
 TGQt.cxx:1094
 TGQt.cxx:1095
 TGQt.cxx:1096
 TGQt.cxx:1097
 TGQt.cxx:1098
 TGQt.cxx:1099
 TGQt.cxx:1100
 TGQt.cxx:1101
 TGQt.cxx:1102
 TGQt.cxx:1103
 TGQt.cxx:1104
 TGQt.cxx:1105
 TGQt.cxx:1106
 TGQt.cxx:1107
 TGQt.cxx:1108
 TGQt.cxx:1109
 TGQt.cxx:1110
 TGQt.cxx:1111
 TGQt.cxx:1112
 TGQt.cxx:1113
 TGQt.cxx:1114
 TGQt.cxx:1115
 TGQt.cxx:1116
 TGQt.cxx:1117
 TGQt.cxx:1118
 TGQt.cxx:1119
 TGQt.cxx:1120
 TGQt.cxx:1121
 TGQt.cxx:1122
 TGQt.cxx:1123
 TGQt.cxx:1124
 TGQt.cxx:1125
 TGQt.cxx:1126
 TGQt.cxx:1127
 TGQt.cxx:1128
 TGQt.cxx:1129
 TGQt.cxx:1130
 TGQt.cxx:1131
 TGQt.cxx:1132
 TGQt.cxx:1133
 TGQt.cxx:1134
 TGQt.cxx:1135
 TGQt.cxx:1136
 TGQt.cxx:1137
 TGQt.cxx:1138
 TGQt.cxx:1139
 TGQt.cxx:1140
 TGQt.cxx:1141
 TGQt.cxx:1142
 TGQt.cxx:1143
 TGQt.cxx:1144
 TGQt.cxx:1145
 TGQt.cxx:1146
 TGQt.cxx:1147
 TGQt.cxx:1148
 TGQt.cxx:1149
 TGQt.cxx:1150
 TGQt.cxx:1151
 TGQt.cxx:1152
 TGQt.cxx:1153
 TGQt.cxx:1154
 TGQt.cxx:1155
 TGQt.cxx:1156
 TGQt.cxx:1157
 TGQt.cxx:1158
 TGQt.cxx:1159
 TGQt.cxx:1160
 TGQt.cxx:1161
 TGQt.cxx:1162
 TGQt.cxx:1163
 TGQt.cxx:1164
 TGQt.cxx:1165
 TGQt.cxx:1166
 TGQt.cxx:1167
 TGQt.cxx:1168
 TGQt.cxx:1169
 TGQt.cxx:1170
 TGQt.cxx:1171
 TGQt.cxx:1172
 TGQt.cxx:1173
 TGQt.cxx:1174
 TGQt.cxx:1175
 TGQt.cxx:1176
 TGQt.cxx:1177
 TGQt.cxx:1178
 TGQt.cxx:1179
 TGQt.cxx:1180
 TGQt.cxx:1181
 TGQt.cxx:1182
 TGQt.cxx:1183
 TGQt.cxx:1184
 TGQt.cxx:1185
 TGQt.cxx:1186
 TGQt.cxx:1187
 TGQt.cxx:1188
 TGQt.cxx:1189
 TGQt.cxx:1190
 TGQt.cxx:1191
 TGQt.cxx:1192
 TGQt.cxx:1193
 TGQt.cxx:1194
 TGQt.cxx:1195
 TGQt.cxx:1196
 TGQt.cxx:1197
 TGQt.cxx:1198
 TGQt.cxx:1199
 TGQt.cxx:1200
 TGQt.cxx:1201
 TGQt.cxx:1202
 TGQt.cxx:1203
 TGQt.cxx:1204
 TGQt.cxx:1205
 TGQt.cxx:1206
 TGQt.cxx:1207
 TGQt.cxx:1208
 TGQt.cxx:1209
 TGQt.cxx:1210
 TGQt.cxx:1211
 TGQt.cxx:1212
 TGQt.cxx:1213
 TGQt.cxx:1214
 TGQt.cxx:1215
 TGQt.cxx:1216
 TGQt.cxx:1217
 TGQt.cxx:1218
 TGQt.cxx:1219
 TGQt.cxx:1220
 TGQt.cxx:1221
 TGQt.cxx:1222
 TGQt.cxx:1223
 TGQt.cxx:1224
 TGQt.cxx:1225
 TGQt.cxx:1226
 TGQt.cxx:1227
 TGQt.cxx:1228
 TGQt.cxx:1229
 TGQt.cxx:1230
 TGQt.cxx:1231
 TGQt.cxx:1232
 TGQt.cxx:1233
 TGQt.cxx:1234
 TGQt.cxx:1235
 TGQt.cxx:1236
 TGQt.cxx:1237
 TGQt.cxx:1238
 TGQt.cxx:1239
 TGQt.cxx:1240
 TGQt.cxx:1241
 TGQt.cxx:1242
 TGQt.cxx:1243
 TGQt.cxx:1244
 TGQt.cxx:1245
 TGQt.cxx:1246
 TGQt.cxx:1247
 TGQt.cxx:1248
 TGQt.cxx:1249
 TGQt.cxx:1250
 TGQt.cxx:1251
 TGQt.cxx:1252
 TGQt.cxx:1253
 TGQt.cxx:1254
 TGQt.cxx:1255
 TGQt.cxx:1256
 TGQt.cxx:1257
 TGQt.cxx:1258
 TGQt.cxx:1259
 TGQt.cxx:1260
 TGQt.cxx:1261
 TGQt.cxx:1262
 TGQt.cxx:1263
 TGQt.cxx:1264
 TGQt.cxx:1265
 TGQt.cxx:1266
 TGQt.cxx:1267
 TGQt.cxx:1268
 TGQt.cxx:1269
 TGQt.cxx:1270
 TGQt.cxx:1271
 TGQt.cxx:1272
 TGQt.cxx:1273
 TGQt.cxx:1274
 TGQt.cxx:1275
 TGQt.cxx:1276
 TGQt.cxx:1277
 TGQt.cxx:1278
 TGQt.cxx:1279
 TGQt.cxx:1280
 TGQt.cxx:1281
 TGQt.cxx:1282
 TGQt.cxx:1283
 TGQt.cxx:1284
 TGQt.cxx:1285
 TGQt.cxx:1286
 TGQt.cxx:1287
 TGQt.cxx:1288
 TGQt.cxx:1289
 TGQt.cxx:1290
 TGQt.cxx:1291
 TGQt.cxx:1292
 TGQt.cxx:1293
 TGQt.cxx:1294
 TGQt.cxx:1295
 TGQt.cxx:1296
 TGQt.cxx:1297
 TGQt.cxx:1298
 TGQt.cxx:1299
 TGQt.cxx:1300
 TGQt.cxx:1301
 TGQt.cxx:1302
 TGQt.cxx:1303
 TGQt.cxx:1304
 TGQt.cxx:1305
 TGQt.cxx:1306
 TGQt.cxx:1307
 TGQt.cxx:1308
 TGQt.cxx:1309
 TGQt.cxx:1310
 TGQt.cxx:1311
 TGQt.cxx:1312
 TGQt.cxx:1313
 TGQt.cxx:1314
 TGQt.cxx:1315
 TGQt.cxx:1316
 TGQt.cxx:1317
 TGQt.cxx:1318
 TGQt.cxx:1319
 TGQt.cxx:1320
 TGQt.cxx:1321
 TGQt.cxx:1322
 TGQt.cxx:1323
 TGQt.cxx:1324
 TGQt.cxx:1325
 TGQt.cxx:1326
 TGQt.cxx:1327
 TGQt.cxx:1328
 TGQt.cxx:1329
 TGQt.cxx:1330
 TGQt.cxx:1331
 TGQt.cxx:1332
 TGQt.cxx:1333
 TGQt.cxx:1334
 TGQt.cxx:1335
 TGQt.cxx:1336
 TGQt.cxx:1337
 TGQt.cxx:1338
 TGQt.cxx:1339
 TGQt.cxx:1340
 TGQt.cxx:1341
 TGQt.cxx:1342
 TGQt.cxx:1343
 TGQt.cxx:1344
 TGQt.cxx:1345
 TGQt.cxx:1346
 TGQt.cxx:1347
 TGQt.cxx:1348
 TGQt.cxx:1349
 TGQt.cxx:1350
 TGQt.cxx:1351
 TGQt.cxx:1352
 TGQt.cxx:1353
 TGQt.cxx:1354
 TGQt.cxx:1355
 TGQt.cxx:1356
 TGQt.cxx:1357
 TGQt.cxx:1358
 TGQt.cxx:1359
 TGQt.cxx:1360
 TGQt.cxx:1361
 TGQt.cxx:1362
 TGQt.cxx:1363
 TGQt.cxx:1364
 TGQt.cxx:1365
 TGQt.cxx:1366
 TGQt.cxx:1367
 TGQt.cxx:1368
 TGQt.cxx:1369
 TGQt.cxx:1370
 TGQt.cxx:1371
 TGQt.cxx:1372
 TGQt.cxx:1373
 TGQt.cxx:1374
 TGQt.cxx:1375
 TGQt.cxx:1376
 TGQt.cxx:1377
 TGQt.cxx:1378
 TGQt.cxx:1379
 TGQt.cxx:1380
 TGQt.cxx:1381
 TGQt.cxx:1382
 TGQt.cxx:1383
 TGQt.cxx:1384
 TGQt.cxx:1385
 TGQt.cxx:1386
 TGQt.cxx:1387
 TGQt.cxx:1388
 TGQt.cxx:1389
 TGQt.cxx:1390
 TGQt.cxx:1391
 TGQt.cxx:1392
 TGQt.cxx:1393
 TGQt.cxx:1394
 TGQt.cxx:1395
 TGQt.cxx:1396
 TGQt.cxx:1397
 TGQt.cxx:1398
 TGQt.cxx:1399
 TGQt.cxx:1400
 TGQt.cxx:1401
 TGQt.cxx:1402
 TGQt.cxx:1403
 TGQt.cxx:1404
 TGQt.cxx:1405
 TGQt.cxx:1406
 TGQt.cxx:1407
 TGQt.cxx:1408
 TGQt.cxx:1409
 TGQt.cxx:1410
 TGQt.cxx:1411
 TGQt.cxx:1412
 TGQt.cxx:1413
 TGQt.cxx:1414
 TGQt.cxx:1415
 TGQt.cxx:1416
 TGQt.cxx:1417
 TGQt.cxx:1418
 TGQt.cxx:1419
 TGQt.cxx:1420
 TGQt.cxx:1421
 TGQt.cxx:1422
 TGQt.cxx:1423
 TGQt.cxx:1424
 TGQt.cxx:1425
 TGQt.cxx:1426
 TGQt.cxx:1427
 TGQt.cxx:1428
 TGQt.cxx:1429
 TGQt.cxx:1430
 TGQt.cxx:1431
 TGQt.cxx:1432
 TGQt.cxx:1433
 TGQt.cxx:1434
 TGQt.cxx:1435
 TGQt.cxx:1436
 TGQt.cxx:1437
 TGQt.cxx:1438
 TGQt.cxx:1439
 TGQt.cxx:1440
 TGQt.cxx:1441
 TGQt.cxx:1442
 TGQt.cxx:1443
 TGQt.cxx:1444
 TGQt.cxx:1445
 TGQt.cxx:1446
 TGQt.cxx:1447
 TGQt.cxx:1448
 TGQt.cxx:1449
 TGQt.cxx:1450
 TGQt.cxx:1451
 TGQt.cxx:1452
 TGQt.cxx:1453
 TGQt.cxx:1454
 TGQt.cxx:1455
 TGQt.cxx:1456
 TGQt.cxx:1457
 TGQt.cxx:1458
 TGQt.cxx:1459
 TGQt.cxx:1460
 TGQt.cxx:1461
 TGQt.cxx:1462
 TGQt.cxx:1463
 TGQt.cxx:1464
 TGQt.cxx:1465
 TGQt.cxx:1466
 TGQt.cxx:1467
 TGQt.cxx:1468
 TGQt.cxx:1469
 TGQt.cxx:1470
 TGQt.cxx:1471
 TGQt.cxx:1472
 TGQt.cxx:1473
 TGQt.cxx:1474
 TGQt.cxx:1475
 TGQt.cxx:1476
 TGQt.cxx:1477
 TGQt.cxx:1478
 TGQt.cxx:1479
 TGQt.cxx:1480
 TGQt.cxx:1481
 TGQt.cxx:1482
 TGQt.cxx:1483
 TGQt.cxx:1484
 TGQt.cxx:1485
 TGQt.cxx:1486
 TGQt.cxx:1487
 TGQt.cxx:1488
 TGQt.cxx:1489
 TGQt.cxx:1490
 TGQt.cxx:1491
 TGQt.cxx:1492
 TGQt.cxx:1493
 TGQt.cxx:1494
 TGQt.cxx:1495
 TGQt.cxx:1496
 TGQt.cxx:1497
 TGQt.cxx:1498
 TGQt.cxx:1499
 TGQt.cxx:1500
 TGQt.cxx:1501
 TGQt.cxx:1502
 TGQt.cxx:1503
 TGQt.cxx:1504
 TGQt.cxx:1505
 TGQt.cxx:1506
 TGQt.cxx:1507
 TGQt.cxx:1508
 TGQt.cxx:1509
 TGQt.cxx:1510
 TGQt.cxx:1511
 TGQt.cxx:1512
 TGQt.cxx:1513
 TGQt.cxx:1514
 TGQt.cxx:1515
 TGQt.cxx:1516
 TGQt.cxx:1517
 TGQt.cxx:1518
 TGQt.cxx:1519
 TGQt.cxx:1520
 TGQt.cxx:1521
 TGQt.cxx:1522
 TGQt.cxx:1523
 TGQt.cxx:1524
 TGQt.cxx:1525
 TGQt.cxx:1526
 TGQt.cxx:1527
 TGQt.cxx:1528
 TGQt.cxx:1529
 TGQt.cxx:1530
 TGQt.cxx:1531
 TGQt.cxx:1532
 TGQt.cxx:1533
 TGQt.cxx:1534
 TGQt.cxx:1535
 TGQt.cxx:1536
 TGQt.cxx:1537
 TGQt.cxx:1538
 TGQt.cxx:1539
 TGQt.cxx:1540
 TGQt.cxx:1541
 TGQt.cxx:1542
 TGQt.cxx:1543
 TGQt.cxx:1544
 TGQt.cxx:1545
 TGQt.cxx:1546
 TGQt.cxx:1547
 TGQt.cxx:1548
 TGQt.cxx:1549
 TGQt.cxx:1550
 TGQt.cxx:1551
 TGQt.cxx:1552
 TGQt.cxx:1553
 TGQt.cxx:1554
 TGQt.cxx:1555
 TGQt.cxx:1556
 TGQt.cxx:1557
 TGQt.cxx:1558
 TGQt.cxx:1559
 TGQt.cxx:1560
 TGQt.cxx:1561
 TGQt.cxx:1562
 TGQt.cxx:1563
 TGQt.cxx:1564
 TGQt.cxx:1565
 TGQt.cxx:1566
 TGQt.cxx:1567
 TGQt.cxx:1568
 TGQt.cxx:1569
 TGQt.cxx:1570
 TGQt.cxx:1571
 TGQt.cxx:1572
 TGQt.cxx:1573
 TGQt.cxx:1574
 TGQt.cxx:1575
 TGQt.cxx:1576
 TGQt.cxx:1577
 TGQt.cxx:1578
 TGQt.cxx:1579
 TGQt.cxx:1580
 TGQt.cxx:1581
 TGQt.cxx:1582
 TGQt.cxx:1583
 TGQt.cxx:1584
 TGQt.cxx:1585
 TGQt.cxx:1586
 TGQt.cxx:1587
 TGQt.cxx:1588
 TGQt.cxx:1589
 TGQt.cxx:1590
 TGQt.cxx:1591
 TGQt.cxx:1592
 TGQt.cxx:1593
 TGQt.cxx:1594
 TGQt.cxx:1595
 TGQt.cxx:1596
 TGQt.cxx:1597
 TGQt.cxx:1598
 TGQt.cxx:1599
 TGQt.cxx:1600
 TGQt.cxx:1601
 TGQt.cxx:1602
 TGQt.cxx:1603
 TGQt.cxx:1604
 TGQt.cxx:1605
 TGQt.cxx:1606
 TGQt.cxx:1607
 TGQt.cxx:1608
 TGQt.cxx:1609
 TGQt.cxx:1610
 TGQt.cxx:1611
 TGQt.cxx:1612
 TGQt.cxx:1613
 TGQt.cxx:1614
 TGQt.cxx:1615
 TGQt.cxx:1616
 TGQt.cxx:1617
 TGQt.cxx:1618
 TGQt.cxx:1619
 TGQt.cxx:1620
 TGQt.cxx:1621
 TGQt.cxx:1622
 TGQt.cxx:1623
 TGQt.cxx:1624
 TGQt.cxx:1625
 TGQt.cxx:1626
 TGQt.cxx:1627
 TGQt.cxx:1628
 TGQt.cxx:1629
 TGQt.cxx:1630
 TGQt.cxx:1631
 TGQt.cxx:1632
 TGQt.cxx:1633
 TGQt.cxx:1634
 TGQt.cxx:1635
 TGQt.cxx:1636
 TGQt.cxx:1637
 TGQt.cxx:1638
 TGQt.cxx:1639
 TGQt.cxx:1640
 TGQt.cxx:1641
 TGQt.cxx:1642
 TGQt.cxx:1643
 TGQt.cxx:1644
 TGQt.cxx:1645
 TGQt.cxx:1646
 TGQt.cxx:1647
 TGQt.cxx:1648
 TGQt.cxx:1649
 TGQt.cxx:1650
 TGQt.cxx:1651
 TGQt.cxx:1652
 TGQt.cxx:1653
 TGQt.cxx:1654
 TGQt.cxx:1655
 TGQt.cxx:1656
 TGQt.cxx:1657
 TGQt.cxx:1658
 TGQt.cxx:1659
 TGQt.cxx:1660
 TGQt.cxx:1661
 TGQt.cxx:1662
 TGQt.cxx:1663
 TGQt.cxx:1664
 TGQt.cxx:1665
 TGQt.cxx:1666
 TGQt.cxx:1667
 TGQt.cxx:1668
 TGQt.cxx:1669
 TGQt.cxx:1670
 TGQt.cxx:1671
 TGQt.cxx:1672
 TGQt.cxx:1673
 TGQt.cxx:1674
 TGQt.cxx:1675
 TGQt.cxx:1676
 TGQt.cxx:1677
 TGQt.cxx:1678
 TGQt.cxx:1679
 TGQt.cxx:1680
 TGQt.cxx:1681
 TGQt.cxx:1682
 TGQt.cxx:1683
 TGQt.cxx:1684
 TGQt.cxx:1685
 TGQt.cxx:1686
 TGQt.cxx:1687
 TGQt.cxx:1688
 TGQt.cxx:1689
 TGQt.cxx:1690
 TGQt.cxx:1691
 TGQt.cxx:1692
 TGQt.cxx:1693
 TGQt.cxx:1694
 TGQt.cxx:1695
 TGQt.cxx:1696
 TGQt.cxx:1697
 TGQt.cxx:1698
 TGQt.cxx:1699
 TGQt.cxx:1700
 TGQt.cxx:1701
 TGQt.cxx:1702
 TGQt.cxx:1703
 TGQt.cxx:1704
 TGQt.cxx:1705
 TGQt.cxx:1706
 TGQt.cxx:1707
 TGQt.cxx:1708
 TGQt.cxx:1709
 TGQt.cxx:1710
 TGQt.cxx:1711
 TGQt.cxx:1712
 TGQt.cxx:1713
 TGQt.cxx:1714
 TGQt.cxx:1715
 TGQt.cxx:1716
 TGQt.cxx:1717
 TGQt.cxx:1718
 TGQt.cxx:1719
 TGQt.cxx:1720
 TGQt.cxx:1721
 TGQt.cxx:1722
 TGQt.cxx:1723
 TGQt.cxx:1724
 TGQt.cxx:1725
 TGQt.cxx:1726
 TGQt.cxx:1727
 TGQt.cxx:1728
 TGQt.cxx:1729
 TGQt.cxx:1730
 TGQt.cxx:1731
 TGQt.cxx:1732
 TGQt.cxx:1733
 TGQt.cxx:1734
 TGQt.cxx:1735
 TGQt.cxx:1736
 TGQt.cxx:1737
 TGQt.cxx:1738
 TGQt.cxx:1739
 TGQt.cxx:1740
 TGQt.cxx:1741
 TGQt.cxx:1742
 TGQt.cxx:1743
 TGQt.cxx:1744
 TGQt.cxx:1745
 TGQt.cxx:1746
 TGQt.cxx:1747
 TGQt.cxx:1748
 TGQt.cxx:1749
 TGQt.cxx:1750
 TGQt.cxx:1751
 TGQt.cxx:1752
 TGQt.cxx:1753
 TGQt.cxx:1754
 TGQt.cxx:1755
 TGQt.cxx:1756
 TGQt.cxx:1757
 TGQt.cxx:1758
 TGQt.cxx:1759
 TGQt.cxx:1760
 TGQt.cxx:1761
 TGQt.cxx:1762
 TGQt.cxx:1763
 TGQt.cxx:1764
 TGQt.cxx:1765
 TGQt.cxx:1766
 TGQt.cxx:1767
 TGQt.cxx:1768
 TGQt.cxx:1769
 TGQt.cxx:1770
 TGQt.cxx:1771
 TGQt.cxx:1772
 TGQt.cxx:1773
 TGQt.cxx:1774
 TGQt.cxx:1775
 TGQt.cxx:1776
 TGQt.cxx:1777
 TGQt.cxx:1778
 TGQt.cxx:1779
 TGQt.cxx:1780
 TGQt.cxx:1781
 TGQt.cxx:1782
 TGQt.cxx:1783
 TGQt.cxx:1784
 TGQt.cxx:1785
 TGQt.cxx:1786
 TGQt.cxx:1787
 TGQt.cxx:1788
 TGQt.cxx:1789
 TGQt.cxx:1790
 TGQt.cxx:1791
 TGQt.cxx:1792
 TGQt.cxx:1793
 TGQt.cxx:1794
 TGQt.cxx:1795
 TGQt.cxx:1796
 TGQt.cxx:1797
 TGQt.cxx:1798
 TGQt.cxx:1799
 TGQt.cxx:1800
 TGQt.cxx:1801
 TGQt.cxx:1802
 TGQt.cxx:1803
 TGQt.cxx:1804
 TGQt.cxx:1805
 TGQt.cxx:1806
 TGQt.cxx:1807
 TGQt.cxx:1808
 TGQt.cxx:1809
 TGQt.cxx:1810
 TGQt.cxx:1811
 TGQt.cxx:1812
 TGQt.cxx:1813
 TGQt.cxx:1814
 TGQt.cxx:1815
 TGQt.cxx:1816
 TGQt.cxx:1817
 TGQt.cxx:1818
 TGQt.cxx:1819
 TGQt.cxx:1820
 TGQt.cxx:1821
 TGQt.cxx:1822
 TGQt.cxx:1823
 TGQt.cxx:1824
 TGQt.cxx:1825
 TGQt.cxx:1826
 TGQt.cxx:1827
 TGQt.cxx:1828
 TGQt.cxx:1829
 TGQt.cxx:1830
 TGQt.cxx:1831
 TGQt.cxx:1832
 TGQt.cxx:1833
 TGQt.cxx:1834
 TGQt.cxx:1835
 TGQt.cxx:1836
 TGQt.cxx:1837
 TGQt.cxx:1838
 TGQt.cxx:1839
 TGQt.cxx:1840
 TGQt.cxx:1841
 TGQt.cxx:1842
 TGQt.cxx:1843
 TGQt.cxx:1844
 TGQt.cxx:1845
 TGQt.cxx:1846
 TGQt.cxx:1847
 TGQt.cxx:1848
 TGQt.cxx:1849
 TGQt.cxx:1850
 TGQt.cxx:1851
 TGQt.cxx:1852
 TGQt.cxx:1853
 TGQt.cxx:1854
 TGQt.cxx:1855
 TGQt.cxx:1856
 TGQt.cxx:1857
 TGQt.cxx:1858
 TGQt.cxx:1859
 TGQt.cxx:1860
 TGQt.cxx:1861
 TGQt.cxx:1862
 TGQt.cxx:1863
 TGQt.cxx:1864
 TGQt.cxx:1865
 TGQt.cxx:1866
 TGQt.cxx:1867
 TGQt.cxx:1868
 TGQt.cxx:1869
 TGQt.cxx:1870
 TGQt.cxx:1871
 TGQt.cxx:1872
 TGQt.cxx:1873
 TGQt.cxx:1874
 TGQt.cxx:1875
 TGQt.cxx:1876
 TGQt.cxx:1877
 TGQt.cxx:1878
 TGQt.cxx:1879
 TGQt.cxx:1880
 TGQt.cxx:1881
 TGQt.cxx:1882
 TGQt.cxx:1883
 TGQt.cxx:1884
 TGQt.cxx:1885
 TGQt.cxx:1886
 TGQt.cxx:1887
 TGQt.cxx:1888
 TGQt.cxx:1889
 TGQt.cxx:1890
 TGQt.cxx:1891
 TGQt.cxx:1892
 TGQt.cxx:1893
 TGQt.cxx:1894
 TGQt.cxx:1895
 TGQt.cxx:1896
 TGQt.cxx:1897
 TGQt.cxx:1898
 TGQt.cxx:1899
 TGQt.cxx:1900
 TGQt.cxx:1901
 TGQt.cxx:1902
 TGQt.cxx:1903
 TGQt.cxx:1904
 TGQt.cxx:1905
 TGQt.cxx:1906
 TGQt.cxx:1907
 TGQt.cxx:1908
 TGQt.cxx:1909
 TGQt.cxx:1910
 TGQt.cxx:1911
 TGQt.cxx:1912
 TGQt.cxx:1913
 TGQt.cxx:1914
 TGQt.cxx:1915
 TGQt.cxx:1916
 TGQt.cxx:1917
 TGQt.cxx:1918
 TGQt.cxx:1919
 TGQt.cxx:1920
 TGQt.cxx:1921
 TGQt.cxx:1922
 TGQt.cxx:1923
 TGQt.cxx:1924
 TGQt.cxx:1925
 TGQt.cxx:1926
 TGQt.cxx:1927
 TGQt.cxx:1928
 TGQt.cxx:1929
 TGQt.cxx:1930
 TGQt.cxx:1931
 TGQt.cxx:1932
 TGQt.cxx:1933
 TGQt.cxx:1934
 TGQt.cxx:1935
 TGQt.cxx:1936
 TGQt.cxx:1937
 TGQt.cxx:1938
 TGQt.cxx:1939
 TGQt.cxx:1940
 TGQt.cxx:1941
 TGQt.cxx:1942
 TGQt.cxx:1943
 TGQt.cxx:1944
 TGQt.cxx:1945
 TGQt.cxx:1946
 TGQt.cxx:1947
 TGQt.cxx:1948
 TGQt.cxx:1949
 TGQt.cxx:1950
 TGQt.cxx:1951
 TGQt.cxx:1952
 TGQt.cxx:1953
 TGQt.cxx:1954
 TGQt.cxx:1955
 TGQt.cxx:1956
 TGQt.cxx:1957
 TGQt.cxx:1958
 TGQt.cxx:1959
 TGQt.cxx:1960
 TGQt.cxx:1961
 TGQt.cxx:1962
 TGQt.cxx:1963
 TGQt.cxx:1964
 TGQt.cxx:1965
 TGQt.cxx:1966
 TGQt.cxx:1967
 TGQt.cxx:1968
 TGQt.cxx:1969
 TGQt.cxx:1970
 TGQt.cxx:1971
 TGQt.cxx:1972
 TGQt.cxx:1973
 TGQt.cxx:1974
 TGQt.cxx:1975
 TGQt.cxx:1976
 TGQt.cxx:1977
 TGQt.cxx:1978
 TGQt.cxx:1979
 TGQt.cxx:1980
 TGQt.cxx:1981
 TGQt.cxx:1982
 TGQt.cxx:1983
 TGQt.cxx:1984
 TGQt.cxx:1985
 TGQt.cxx:1986
 TGQt.cxx:1987
 TGQt.cxx:1988
 TGQt.cxx:1989
 TGQt.cxx:1990
 TGQt.cxx:1991
 TGQt.cxx:1992
 TGQt.cxx:1993
 TGQt.cxx:1994
 TGQt.cxx:1995
 TGQt.cxx:1996
 TGQt.cxx:1997
 TGQt.cxx:1998
 TGQt.cxx:1999
 TGQt.cxx:2000
 TGQt.cxx:2001
 TGQt.cxx:2002
 TGQt.cxx:2003
 TGQt.cxx:2004
 TGQt.cxx:2005
 TGQt.cxx:2006
 TGQt.cxx:2007
 TGQt.cxx:2008
 TGQt.cxx:2009
 TGQt.cxx:2010
 TGQt.cxx:2011
 TGQt.cxx:2012
 TGQt.cxx:2013
 TGQt.cxx:2014
 TGQt.cxx:2015
 TGQt.cxx:2016
 TGQt.cxx:2017
 TGQt.cxx:2018
 TGQt.cxx:2019
 TGQt.cxx:2020
 TGQt.cxx:2021
 TGQt.cxx:2022
 TGQt.cxx:2023
 TGQt.cxx:2024
 TGQt.cxx:2025
 TGQt.cxx:2026
 TGQt.cxx:2027
 TGQt.cxx:2028
 TGQt.cxx:2029
 TGQt.cxx:2030
 TGQt.cxx:2031
 TGQt.cxx:2032
 TGQt.cxx:2033
 TGQt.cxx:2034
 TGQt.cxx:2035
 TGQt.cxx:2036
 TGQt.cxx:2037
 TGQt.cxx:2038
 TGQt.cxx:2039
 TGQt.cxx:2040
 TGQt.cxx:2041
 TGQt.cxx:2042
 TGQt.cxx:2043
 TGQt.cxx:2044
 TGQt.cxx:2045
 TGQt.cxx:2046
 TGQt.cxx:2047
 TGQt.cxx:2048
 TGQt.cxx:2049
 TGQt.cxx:2050
 TGQt.cxx:2051
 TGQt.cxx:2052
 TGQt.cxx:2053
 TGQt.cxx:2054
 TGQt.cxx:2055
 TGQt.cxx:2056
 TGQt.cxx:2057
 TGQt.cxx:2058
 TGQt.cxx:2059
 TGQt.cxx:2060
 TGQt.cxx:2061
 TGQt.cxx:2062
 TGQt.cxx:2063
 TGQt.cxx:2064
 TGQt.cxx:2065
 TGQt.cxx:2066
 TGQt.cxx:2067
 TGQt.cxx:2068
 TGQt.cxx:2069
 TGQt.cxx:2070
 TGQt.cxx:2071
 TGQt.cxx:2072
 TGQt.cxx:2073
 TGQt.cxx:2074
 TGQt.cxx:2075
 TGQt.cxx:2076
 TGQt.cxx:2077
 TGQt.cxx:2078
 TGQt.cxx:2079
 TGQt.cxx:2080
 TGQt.cxx:2081
 TGQt.cxx:2082
 TGQt.cxx:2083
 TGQt.cxx:2084
 TGQt.cxx:2085
 TGQt.cxx:2086
 TGQt.cxx:2087
 TGQt.cxx:2088
 TGQt.cxx:2089
 TGQt.cxx:2090
 TGQt.cxx:2091
 TGQt.cxx:2092
 TGQt.cxx:2093
 TGQt.cxx:2094
 TGQt.cxx:2095
 TGQt.cxx:2096
 TGQt.cxx:2097
 TGQt.cxx:2098
 TGQt.cxx:2099
 TGQt.cxx:2100
 TGQt.cxx:2101
 TGQt.cxx:2102
 TGQt.cxx:2103
 TGQt.cxx:2104
 TGQt.cxx:2105
 TGQt.cxx:2106
 TGQt.cxx:2107
 TGQt.cxx:2108
 TGQt.cxx:2109
 TGQt.cxx:2110
 TGQt.cxx:2111
 TGQt.cxx:2112
 TGQt.cxx:2113
 TGQt.cxx:2114
 TGQt.cxx:2115
 TGQt.cxx:2116
 TGQt.cxx:2117
 TGQt.cxx:2118
 TGQt.cxx:2119
 TGQt.cxx:2120
 TGQt.cxx:2121
 TGQt.cxx:2122
 TGQt.cxx:2123
 TGQt.cxx:2124
 TGQt.cxx:2125
 TGQt.cxx:2126
 TGQt.cxx:2127
 TGQt.cxx:2128
 TGQt.cxx:2129
 TGQt.cxx:2130
 TGQt.cxx:2131
 TGQt.cxx:2132
 TGQt.cxx:2133
 TGQt.cxx:2134
 TGQt.cxx:2135
 TGQt.cxx:2136
 TGQt.cxx:2137
 TGQt.cxx:2138
 TGQt.cxx:2139
 TGQt.cxx:2140
 TGQt.cxx:2141
 TGQt.cxx:2142
 TGQt.cxx:2143
 TGQt.cxx:2144
 TGQt.cxx:2145
 TGQt.cxx:2146
 TGQt.cxx:2147
 TGQt.cxx:2148
 TGQt.cxx:2149
 TGQt.cxx:2150
 TGQt.cxx:2151
 TGQt.cxx:2152
 TGQt.cxx:2153
 TGQt.cxx:2154
 TGQt.cxx:2155
 TGQt.cxx:2156
 TGQt.cxx:2157
 TGQt.cxx:2158
 TGQt.cxx:2159
 TGQt.cxx:2160
 TGQt.cxx:2161
 TGQt.cxx:2162
 TGQt.cxx:2163
 TGQt.cxx:2164
 TGQt.cxx:2165
 TGQt.cxx:2166
 TGQt.cxx:2167
 TGQt.cxx:2168
 TGQt.cxx:2169
 TGQt.cxx:2170
 TGQt.cxx:2171
 TGQt.cxx:2172
 TGQt.cxx:2173
 TGQt.cxx:2174
 TGQt.cxx:2175
 TGQt.cxx:2176
 TGQt.cxx:2177
 TGQt.cxx:2178
 TGQt.cxx:2179
 TGQt.cxx:2180
 TGQt.cxx:2181
 TGQt.cxx:2182
 TGQt.cxx:2183
 TGQt.cxx:2184
 TGQt.cxx:2185
 TGQt.cxx:2186
 TGQt.cxx:2187
 TGQt.cxx:2188
 TGQt.cxx:2189
 TGQt.cxx:2190
 TGQt.cxx:2191
 TGQt.cxx:2192
 TGQt.cxx:2193
 TGQt.cxx:2194
 TGQt.cxx:2195
 TGQt.cxx:2196
 TGQt.cxx:2197
 TGQt.cxx:2198
 TGQt.cxx:2199
 TGQt.cxx:2200
 TGQt.cxx:2201
 TGQt.cxx:2202
 TGQt.cxx:2203
 TGQt.cxx:2204
 TGQt.cxx:2205
 TGQt.cxx:2206
 TGQt.cxx:2207
 TGQt.cxx:2208
 TGQt.cxx:2209
 TGQt.cxx:2210
 TGQt.cxx:2211
 TGQt.cxx:2212
 TGQt.cxx:2213
 TGQt.cxx:2214
 TGQt.cxx:2215
 TGQt.cxx:2216
 TGQt.cxx:2217
 TGQt.cxx:2218
 TGQt.cxx:2219
 TGQt.cxx:2220
 TGQt.cxx:2221
 TGQt.cxx:2222
 TGQt.cxx:2223
 TGQt.cxx:2224
 TGQt.cxx:2225
 TGQt.cxx:2226
 TGQt.cxx:2227
 TGQt.cxx:2228
 TGQt.cxx:2229
 TGQt.cxx:2230
 TGQt.cxx:2231
 TGQt.cxx:2232
 TGQt.cxx:2233
 TGQt.cxx:2234
 TGQt.cxx:2235
 TGQt.cxx:2236
 TGQt.cxx:2237
 TGQt.cxx:2238
 TGQt.cxx:2239
 TGQt.cxx:2240
 TGQt.cxx:2241
 TGQt.cxx:2242
 TGQt.cxx:2243
 TGQt.cxx:2244
 TGQt.cxx:2245
 TGQt.cxx:2246
 TGQt.cxx:2247
 TGQt.cxx:2248
 TGQt.cxx:2249
 TGQt.cxx:2250
 TGQt.cxx:2251
 TGQt.cxx:2252
 TGQt.cxx:2253
 TGQt.cxx:2254
 TGQt.cxx:2255
 TGQt.cxx:2256
 TGQt.cxx:2257
 TGQt.cxx:2258
 TGQt.cxx:2259
 TGQt.cxx:2260
 TGQt.cxx:2261
 TGQt.cxx:2262
 TGQt.cxx:2263
 TGQt.cxx:2264
 TGQt.cxx:2265
 TGQt.cxx:2266
 TGQt.cxx:2267
 TGQt.cxx:2268
 TGQt.cxx:2269
 TGQt.cxx:2270
 TGQt.cxx:2271
 TGQt.cxx:2272
 TGQt.cxx:2273
 TGQt.cxx:2274
 TGQt.cxx:2275
 TGQt.cxx:2276
 TGQt.cxx:2277
 TGQt.cxx:2278
 TGQt.cxx:2279
 TGQt.cxx:2280
 TGQt.cxx:2281
 TGQt.cxx:2282
 TGQt.cxx:2283
 TGQt.cxx:2284
 TGQt.cxx:2285
 TGQt.cxx:2286
 TGQt.cxx:2287
 TGQt.cxx:2288
 TGQt.cxx:2289
 TGQt.cxx:2290
 TGQt.cxx:2291
 TGQt.cxx:2292
 TGQt.cxx:2293
 TGQt.cxx:2294
 TGQt.cxx:2295
 TGQt.cxx:2296
 TGQt.cxx:2297
 TGQt.cxx:2298
 TGQt.cxx:2299
 TGQt.cxx:2300
 TGQt.cxx:2301
 TGQt.cxx:2302
 TGQt.cxx:2303
 TGQt.cxx:2304
 TGQt.cxx:2305
 TGQt.cxx:2306
 TGQt.cxx:2307
 TGQt.cxx:2308
 TGQt.cxx:2309
 TGQt.cxx:2310
 TGQt.cxx:2311
 TGQt.cxx:2312
 TGQt.cxx:2313
 TGQt.cxx:2314
 TGQt.cxx:2315
 TGQt.cxx:2316
 TGQt.cxx:2317
 TGQt.cxx:2318
 TGQt.cxx:2319
 TGQt.cxx:2320
 TGQt.cxx:2321
 TGQt.cxx:2322
 TGQt.cxx:2323
 TGQt.cxx:2324
 TGQt.cxx:2325
 TGQt.cxx:2326
 TGQt.cxx:2327
 TGQt.cxx:2328
 TGQt.cxx:2329
 TGQt.cxx:2330
 TGQt.cxx:2331
 TGQt.cxx:2332
 TGQt.cxx:2333
 TGQt.cxx:2334
 TGQt.cxx:2335
 TGQt.cxx:2336
 TGQt.cxx:2337
 TGQt.cxx:2338
 TGQt.cxx:2339
 TGQt.cxx:2340
 TGQt.cxx:2341
 TGQt.cxx:2342
 TGQt.cxx:2343
 TGQt.cxx:2344
 TGQt.cxx:2345
 TGQt.cxx:2346
 TGQt.cxx:2347
 TGQt.cxx:2348
 TGQt.cxx:2349
 TGQt.cxx:2350
 TGQt.cxx:2351
 TGQt.cxx:2352
 TGQt.cxx:2353
 TGQt.cxx:2354
 TGQt.cxx:2355
 TGQt.cxx:2356
 TGQt.cxx:2357
 TGQt.cxx:2358
 TGQt.cxx:2359
 TGQt.cxx:2360
 TGQt.cxx:2361
 TGQt.cxx:2362
 TGQt.cxx:2363
 TGQt.cxx:2364
 TGQt.cxx:2365
 TGQt.cxx:2366
 TGQt.cxx:2367
 TGQt.cxx:2368
 TGQt.cxx:2369
 TGQt.cxx:2370
 TGQt.cxx:2371
 TGQt.cxx:2372
 TGQt.cxx:2373
 TGQt.cxx:2374
 TGQt.cxx:2375
 TGQt.cxx:2376
 TGQt.cxx:2377
 TGQt.cxx:2378
 TGQt.cxx:2379
 TGQt.cxx:2380
 TGQt.cxx:2381
 TGQt.cxx:2382
 TGQt.cxx:2383
 TGQt.cxx:2384
 TGQt.cxx:2385
 TGQt.cxx:2386
 TGQt.cxx:2387
 TGQt.cxx:2388
 TGQt.cxx:2389
 TGQt.cxx:2390
 TGQt.cxx:2391
 TGQt.cxx:2392
 TGQt.cxx:2393
 TGQt.cxx:2394
 TGQt.cxx:2395
 TGQt.cxx:2396
 TGQt.cxx:2397
 TGQt.cxx:2398
 TGQt.cxx:2399
 TGQt.cxx:2400
 TGQt.cxx:2401
 TGQt.cxx:2402
 TGQt.cxx:2403
 TGQt.cxx:2404
 TGQt.cxx:2405
 TGQt.cxx:2406
 TGQt.cxx:2407
 TGQt.cxx:2408
 TGQt.cxx:2409
 TGQt.cxx:2410
 TGQt.cxx:2411
 TGQt.cxx:2412
 TGQt.cxx:2413
 TGQt.cxx:2414
 TGQt.cxx:2415
 TGQt.cxx:2416
 TGQt.cxx:2417
 TGQt.cxx:2418
 TGQt.cxx:2419
 TGQt.cxx:2420
 TGQt.cxx:2421
 TGQt.cxx:2422
 TGQt.cxx:2423
 TGQt.cxx:2424
 TGQt.cxx:2425
 TGQt.cxx:2426
 TGQt.cxx:2427
 TGQt.cxx:2428
 TGQt.cxx:2429
 TGQt.cxx:2430
 TGQt.cxx:2431
 TGQt.cxx:2432
 TGQt.cxx:2433
 TGQt.cxx:2434
 TGQt.cxx:2435
 TGQt.cxx:2436
 TGQt.cxx:2437
 TGQt.cxx:2438
 TGQt.cxx:2439
 TGQt.cxx:2440
 TGQt.cxx:2441
 TGQt.cxx:2442
 TGQt.cxx:2443
 TGQt.cxx:2444
 TGQt.cxx:2445
 TGQt.cxx:2446
 TGQt.cxx:2447
 TGQt.cxx:2448
 TGQt.cxx:2449
 TGQt.cxx:2450
 TGQt.cxx:2451
 TGQt.cxx:2452
 TGQt.cxx:2453
 TGQt.cxx:2454
 TGQt.cxx:2455
 TGQt.cxx:2456
 TGQt.cxx:2457
 TGQt.cxx:2458
 TGQt.cxx:2459
 TGQt.cxx:2460
 TGQt.cxx:2461
 TGQt.cxx:2462
 TGQt.cxx:2463
 TGQt.cxx:2464
 TGQt.cxx:2465
 TGQt.cxx:2466
 TGQt.cxx:2467
 TGQt.cxx:2468
 TGQt.cxx:2469
 TGQt.cxx:2470
 TGQt.cxx:2471
 TGQt.cxx:2472
 TGQt.cxx:2473
 TGQt.cxx:2474
 TGQt.cxx:2475
 TGQt.cxx:2476
 TGQt.cxx:2477
 TGQt.cxx:2478
 TGQt.cxx:2479
 TGQt.cxx:2480
 TGQt.cxx:2481
 TGQt.cxx:2482
 TGQt.cxx:2483
 TGQt.cxx:2484
 TGQt.cxx:2485
 TGQt.cxx:2486
 TGQt.cxx:2487
 TGQt.cxx:2488
 TGQt.cxx:2489
 TGQt.cxx:2490
 TGQt.cxx:2491
 TGQt.cxx:2492
 TGQt.cxx:2493
 TGQt.cxx:2494
 TGQt.cxx:2495
 TGQt.cxx:2496
 TGQt.cxx:2497
 TGQt.cxx:2498
 TGQt.cxx:2499
 TGQt.cxx:2500
 TGQt.cxx:2501
 TGQt.cxx:2502
 TGQt.cxx:2503
 TGQt.cxx:2504
 TGQt.cxx:2505
 TGQt.cxx:2506
 TGQt.cxx:2507
 TGQt.cxx:2508
 TGQt.cxx:2509
 TGQt.cxx:2510
 TGQt.cxx:2511
 TGQt.cxx:2512
 TGQt.cxx:2513
 TGQt.cxx:2514
 TGQt.cxx:2515
 TGQt.cxx:2516
 TGQt.cxx:2517
 TGQt.cxx:2518
 TGQt.cxx:2519
 TGQt.cxx:2520
 TGQt.cxx:2521
 TGQt.cxx:2522
 TGQt.cxx:2523
 TGQt.cxx:2524
 TGQt.cxx:2525
 TGQt.cxx:2526
 TGQt.cxx:2527
 TGQt.cxx:2528
 TGQt.cxx:2529
 TGQt.cxx:2530
 TGQt.cxx:2531
 TGQt.cxx:2532
 TGQt.cxx:2533
 TGQt.cxx:2534
 TGQt.cxx:2535
 TGQt.cxx:2536
 TGQt.cxx:2537
 TGQt.cxx:2538
 TGQt.cxx:2539
 TGQt.cxx:2540
 TGQt.cxx:2541
 TGQt.cxx:2542
 TGQt.cxx:2543
 TGQt.cxx:2544
 TGQt.cxx:2545
 TGQt.cxx:2546
 TGQt.cxx:2547
 TGQt.cxx:2548
 TGQt.cxx:2549
 TGQt.cxx:2550
 TGQt.cxx:2551
 TGQt.cxx:2552
 TGQt.cxx:2553
 TGQt.cxx:2554
 TGQt.cxx:2555
 TGQt.cxx:2556
 TGQt.cxx:2557
 TGQt.cxx:2558
 TGQt.cxx:2559
 TGQt.cxx:2560
 TGQt.cxx:2561
 TGQt.cxx:2562
 TGQt.cxx:2563
 TGQt.cxx:2564
 TGQt.cxx:2565
 TGQt.cxx:2566
 TGQt.cxx:2567
 TGQt.cxx:2568
 TGQt.cxx:2569
 TGQt.cxx:2570
 TGQt.cxx:2571
 TGQt.cxx:2572
 TGQt.cxx:2573
 TGQt.cxx:2574
 TGQt.cxx:2575
 TGQt.cxx:2576
 TGQt.cxx:2577
 TGQt.cxx:2578
 TGQt.cxx:2579
 TGQt.cxx:2580
 TGQt.cxx:2581
 TGQt.cxx:2582
 TGQt.cxx:2583
 TGQt.cxx:2584
 TGQt.cxx:2585
 TGQt.cxx:2586
 TGQt.cxx:2587
 TGQt.cxx:2588
 TGQt.cxx:2589
 TGQt.cxx:2590
 TGQt.cxx:2591
 TGQt.cxx:2592
 TGQt.cxx:2593
 TGQt.cxx:2594
 TGQt.cxx:2595
 TGQt.cxx:2596
 TGQt.cxx:2597
 TGQt.cxx:2598
 TGQt.cxx:2599
 TGQt.cxx:2600
 TGQt.cxx:2601
 TGQt.cxx:2602
 TGQt.cxx:2603
 TGQt.cxx:2604
 TGQt.cxx:2605
 TGQt.cxx:2606
 TGQt.cxx:2607
 TGQt.cxx:2608
 TGQt.cxx:2609
 TGQt.cxx:2610
 TGQt.cxx:2611
 TGQt.cxx:2612
 TGQt.cxx:2613
 TGQt.cxx:2614
 TGQt.cxx:2615
 TGQt.cxx:2616
 TGQt.cxx:2617
 TGQt.cxx:2618
 TGQt.cxx:2619
 TGQt.cxx:2620
 TGQt.cxx:2621
 TGQt.cxx:2622
 TGQt.cxx:2623
 TGQt.cxx:2624
 TGQt.cxx:2625
 TGQt.cxx:2626
 TGQt.cxx:2627
 TGQt.cxx:2628
 TGQt.cxx:2629
 TGQt.cxx:2630
 TGQt.cxx:2631
 TGQt.cxx:2632
 TGQt.cxx:2633
 TGQt.cxx:2634
 TGQt.cxx:2635
 TGQt.cxx:2636
 TGQt.cxx:2637
 TGQt.cxx:2638
 TGQt.cxx:2639
 TGQt.cxx:2640
 TGQt.cxx:2641
 TGQt.cxx:2642
 TGQt.cxx:2643
 TGQt.cxx:2644
 TGQt.cxx:2645
 TGQt.cxx:2646
 TGQt.cxx:2647
 TGQt.cxx:2648
 TGQt.cxx:2649
 TGQt.cxx:2650
 TGQt.cxx:2651
 TGQt.cxx:2652
 TGQt.cxx:2653
 TGQt.cxx:2654
 TGQt.cxx:2655
 TGQt.cxx:2656
 TGQt.cxx:2657
 TGQt.cxx:2658
 TGQt.cxx:2659
 TGQt.cxx:2660
 TGQt.cxx:2661
 TGQt.cxx:2662
 TGQt.cxx:2663
 TGQt.cxx:2664
 TGQt.cxx:2665
 TGQt.cxx:2666
 TGQt.cxx:2667
 TGQt.cxx:2668
 TGQt.cxx:2669
 TGQt.cxx:2670
 TGQt.cxx:2671
 TGQt.cxx:2672
 TGQt.cxx:2673
 TGQt.cxx:2674
 TGQt.cxx:2675
 TGQt.cxx:2676
 TGQt.cxx:2677
 TGQt.cxx:2678
 TGQt.cxx:2679
 TGQt.cxx:2680
 TGQt.cxx:2681
 TGQt.cxx:2682
 TGQt.cxx:2683
 TGQt.cxx:2684
 TGQt.cxx:2685
 TGQt.cxx:2686
 TGQt.cxx:2687
 TGQt.cxx:2688
 TGQt.cxx:2689
 TGQt.cxx:2690
 TGQt.cxx:2691
 TGQt.cxx:2692
 TGQt.cxx:2693
 TGQt.cxx:2694
 TGQt.cxx:2695
 TGQt.cxx:2696
 TGQt.cxx:2697
 TGQt.cxx:2698
 TGQt.cxx:2699
 TGQt.cxx:2700
 TGQt.cxx:2701
 TGQt.cxx:2702
 TGQt.cxx:2703
 TGQt.cxx:2704
 TGQt.cxx:2705
 TGQt.cxx:2706
 TGQt.cxx:2707
 TGQt.cxx:2708
 TGQt.cxx:2709
 TGQt.cxx:2710
 TGQt.cxx:2711
 TGQt.cxx:2712
 TGQt.cxx:2713
 TGQt.cxx:2714
 TGQt.cxx:2715
 TGQt.cxx:2716
 TGQt.cxx:2717
 TGQt.cxx:2718
 TGQt.cxx:2719
 TGQt.cxx:2720
 TGQt.cxx:2721
 TGQt.cxx:2722
 TGQt.cxx:2723
 TGQt.cxx:2724
 TGQt.cxx:2725
 TGQt.cxx:2726
 TGQt.cxx:2727
 TGQt.cxx:2728
 TGQt.cxx:2729
 TGQt.cxx:2730
 TGQt.cxx:2731
 TGQt.cxx:2732
 TGQt.cxx:2733
 TGQt.cxx:2734
 TGQt.cxx:2735
 TGQt.cxx:2736
 TGQt.cxx:2737
 TGQt.cxx:2738
 TGQt.cxx:2739
 TGQt.cxx:2740
 TGQt.cxx:2741
 TGQt.cxx:2742
 TGQt.cxx:2743
 TGQt.cxx:2744
 TGQt.cxx:2745
 TGQt.cxx:2746
 TGQt.cxx:2747
 TGQt.cxx:2748
 TGQt.cxx:2749
 TGQt.cxx:2750
 TGQt.cxx:2751
 TGQt.cxx:2752
 TGQt.cxx:2753
 TGQt.cxx:2754
 TGQt.cxx:2755
 TGQt.cxx:2756
 TGQt.cxx:2757
 TGQt.cxx:2758
 TGQt.cxx:2759
 TGQt.cxx:2760
 TGQt.cxx:2761
 TGQt.cxx:2762
 TGQt.cxx:2763
 TGQt.cxx:2764
 TGQt.cxx:2765
 TGQt.cxx:2766
 TGQt.cxx:2767
 TGQt.cxx:2768
 TGQt.cxx:2769
 TGQt.cxx:2770
 TGQt.cxx:2771
 TGQt.cxx:2772
 TGQt.cxx:2773
 TGQt.cxx:2774
 TGQt.cxx:2775
 TGQt.cxx:2776
 TGQt.cxx:2777
 TGQt.cxx:2778
 TGQt.cxx:2779
 TGQt.cxx:2780
 TGQt.cxx:2781
 TGQt.cxx:2782
 TGQt.cxx:2783
 TGQt.cxx:2784
 TGQt.cxx:2785
 TGQt.cxx:2786
 TGQt.cxx:2787
 TGQt.cxx:2788
 TGQt.cxx:2789
 TGQt.cxx:2790
 TGQt.cxx:2791
 TGQt.cxx:2792
 TGQt.cxx:2793
 TGQt.cxx:2794
 TGQt.cxx:2795
 TGQt.cxx:2796
 TGQt.cxx:2797
 TGQt.cxx:2798
 TGQt.cxx:2799
 TGQt.cxx:2800
 TGQt.cxx:2801
 TGQt.cxx:2802
 TGQt.cxx:2803
 TGQt.cxx:2804
 TGQt.cxx:2805
 TGQt.cxx:2806
 TGQt.cxx:2807
 TGQt.cxx:2808
 TGQt.cxx:2809
 TGQt.cxx:2810
 TGQt.cxx:2811
 TGQt.cxx:2812
 TGQt.cxx:2813
 TGQt.cxx:2814
 TGQt.cxx:2815
 TGQt.cxx:2816
 TGQt.cxx:2817
 TGQt.cxx:2818
 TGQt.cxx:2819
 TGQt.cxx:2820
 TGQt.cxx:2821
 TGQt.cxx:2822
 TGQt.cxx:2823
 TGQt.cxx:2824
 TGQt.cxx:2825
 TGQt.cxx:2826
 TGQt.cxx:2827
 TGQt.cxx:2828
 TGQt.cxx:2829
 TGQt.cxx:2830
 TGQt.cxx:2831
 TGQt.cxx:2832
 TGQt.cxx:2833
 TGQt.cxx:2834
 TGQt.cxx:2835
 TGQt.cxx:2836
 TGQt.cxx:2837
 TGQt.cxx:2838
 TGQt.cxx:2839
 TGQt.cxx:2840
 TGQt.cxx:2841
 TGQt.cxx:2842
 TGQt.cxx:2843
 TGQt.cxx:2844
 TGQt.cxx:2845
 TGQt.cxx:2846
 TGQt.cxx:2847
 TGQt.cxx:2848
 TGQt.cxx:2849
 TGQt.cxx:2850
 TGQt.cxx:2851
 TGQt.cxx:2852
 TGQt.cxx:2853
 TGQt.cxx:2854