ROOT logo
// @(#)root/gui:$Id: TGLayout.cxx 38754 2011-04-06 13:26:09Z bellenot $
// Author: Fons Rademakers   02/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
/**************************************************************************

    This source is based on Xclass95, a Win95-looking GUI toolkit.
    Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.

    Xclass95 is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

**************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// A number of different layout classes (TGLayoutManager,               //
// TGVerticalLayout, TGHorizontalLayout, TGLayoutHints, etc.).          //
//                                                                      //
//                                                                      //
// Concerning the TGMatrixLayout class:                                 //
//                                                                      //
// It arranges frames in a matrix-like way.                             //
// This manager provides :                                              //
// - a column number (0 means unlimited)                                //
// - a row number (0 means unlimited)                                   //
// - horizontal & vertical separators                                   //
//                                                                      //
// Notes : If both column and row are fixed values, any remaining       //
//         frames outside the count won't be managed.                   //
//         Unlimited rows means the frame can expand downward           //
//         (the default behaviour in most UI).                          //
//         Both unlimited rows and columns is undefined (read: will     //
//         crash the algorithm ;-).                                     //
//         With fixed dimensions, frames are always arranged in rows.   //
//         That is: 1st frame is at position (0,0), next one is at      //
//         row(0), column(1) and so on...                               //
//         When specifying one dimension as unlimited (i.e. row=0 or    //
//         column=0) the frames are arranged according to the direction //
//         of the fixed dimension. This layout manager does not make    //
//         use of TGLayoutHints.                                        //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TGLayout.h"
#include "TGFrame.h"
#include "TList.h"
#include "Riostream.h"


ClassImp(TGLayoutHints)
ClassImp(TGLayoutManager)
ClassImp(TGVerticalLayout)
ClassImp(TGHorizontalLayout)
ClassImp(TGRowLayout)
ClassImp(TGColumnLayout)
ClassImp(TGMatrixLayout)
ClassImp(TGTileLayout)
ClassImp(TGListLayout)
ClassImp(TGListDetailsLayout)


//______________________________________________________________________________
TGFrameElement::TGFrameElement(TGFrame *f, TGLayoutHints *l)
{
   // Constructor.

   fLayout = 0;
   fFrame  = f;
   if (f) f->SetFrameElement(this);

   if (l) {
      l->AddReference();
      fLayout = l;
      l->fPrev = l->fFE;
      l->fFE = this;
   }
   fState = 1;
}

//______________________________________________________________________________
TGFrameElement::~TGFrameElement()
{
   // Destructor. Decrease ref. count of fLayout.

}

//______________________________________________________________________________
void TGFrameElement::Print(Option_t *option) const
{
   // Print this frame element.

   TObject::Print(option);

   cout << "\t";
   if (fFrame) {
      cout << fFrame->ClassName() << "::" << fFrame->GetName();
   }
   if (fLayout) {
      fLayout->Print(option);
   }
   cout << endl;
}

//______________________________________________________________________________
TGLayoutHints::TGLayoutHints(const TGLayoutHints &lh) : TObject(lh), TRefCnt(lh)
{
   // Constructor.

   fPadleft = lh.fPadleft; fPadright = lh.fPadright;
   fPadtop  = lh.fPadtop;  fPadbottom = lh.fPadbottom;
   fLayoutHints = lh.fLayoutHints;
   SetRefCount(0);
   fFE = lh.fFE; fPrev = lh.fPrev;
}

//______________________________________________________________________________
TGLayoutHints::~TGLayoutHints()
{
   // Destructor.

}

//______________________________________________________________________________
void TGLayoutHints::UpdateFrameElements(TGLayoutHints *l)
{
   // Update layout hints of frame elements.

   if (fFE) fFE->fLayout = l;
   else return;

   TGFrameElement *p = fPrev;

   while (p && p->fLayout) {
      p->fLayout = l;
      p = p->fLayout->fPrev;
   }
}

//______________________________________________________________________________
void TGLayoutHints::Print(Option_t *) const
{
   // Printing.

   Bool_t bor = kFALSE;

   if (fLayoutHints & kLHintsLeft) {
      cout << "kLHintsLeft";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsCenterX) {
      if (bor) cout << " | ";
      cout << "kLHintsCenterX";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsRight) {
      if (bor) cout << " | ";
      cout << "kLHintsRight";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsTop) {
      if (bor) cout << " | ";
      cout << "kLHintsTop";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsCenterY) {
      if (bor) cout << " | ";
      cout << "kLHintsCenterY";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsBottom) {
      if (bor) cout << " | ";
      cout << "kLHintsBottom";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsExpandX) {
      if (bor) cout << " | ";
      cout << "kLHintsExpandX";
      bor = kTRUE;
   }
   if (fLayoutHints & kLHintsExpandY) {
      if (bor) cout << " | ";
      cout << "kLHintsExpandY";
      bor = kTRUE;
   }
   if (fLayoutHints == kLHintsNoHints) {
      if (bor) cout << " | ";
      cout << "kLHintsNoHints";
   }
   cout << ", fPadtop="    << fPadtop;
   cout << ", fPadbottom=" << fPadbottom;
   cout << ", fPadleft="   << fPadleft;
   cout << ", fPadright="  << fPadright;
   cout << endl;
}

//______________________________________________________________________________
TGVerticalLayout::TGVerticalLayout(TGCompositeFrame *main)
{
   // Create vertical layout manager.

   fMain = main;
   fList = fMain->GetList();
}

//______________________________________________________________________________
void TGVerticalLayout::Layout()
{
   // Make a vertical layout of all frames in the list.

   TGFrameElement *ptr;
   TGLayoutHints  *layout;
   Int_t    nb_expand = 0;
   Int_t    top, bottom;
   ULong_t  hints;
   UInt_t   extra_space = 0;
   Int_t    exp = 0;
   Int_t    exp_max = 0;
   Int_t    remain;
   Int_t    x = 0, y = 0;
   Int_t    bw = fMain->GetBorderWidth();
   TGDimension size(0,0), csize(0,0);
   TGDimension msize = fMain->GetSize();
   UInt_t pad_left, pad_top, pad_right, pad_bottom;
   Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;

   if (!fList) return;

   fModified = kFALSE;

   bottom = msize.fHeight - (top = bw);
   remain = msize.fHeight - (bw << 1);

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         layout = ptr->fLayout;
         size = ptr->fFrame->GetDefaultSize();
         size.fHeight += layout->GetPadTop() + layout->GetPadBottom();
         hints = layout->GetLayoutHints();
         if ((hints & kLHintsExpandY) || (hints & kLHintsCenterY)) {
            nb_expand++;
            exp += size.fHeight;
            if (hints & kLHintsExpandY) exp_max = 0;
            else exp_max = TMath::Max(exp_max, (Int_t)size.fHeight);
         } else {
            remain -= size.fHeight;
            if (remain < 0)
               remain = 0;
         }
      }
   }

   if (nb_expand) {
      size_expand = remain/nb_expand;

      if (size_expand < exp_max)
         esize_expand = (remain - exp)/nb_expand;
      rem_expand = remain % nb_expand;
   }

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         hints = (layout = ptr->fLayout)->GetLayoutHints();
         csize      = ptr->fFrame->GetDefaultSize();
         pad_left   = layout->GetPadLeft();
         pad_top    = layout->GetPadTop();
         pad_right  = layout->GetPadRight();
         pad_bottom = layout->GetPadBottom();

         if (hints & kLHintsRight) {
            x = msize.fWidth - bw - csize.fWidth - pad_right;
         } else if (hints & kLHintsCenterX) {
            x = (msize.fWidth - (bw << 1) - csize.fWidth) >> 1;
         } else { // defaults to kLHintsLeft
            x = pad_left + bw;
         }

         if (hints & kLHintsExpandX) {
            size.fWidth = msize.fWidth - (bw << 1) - pad_left - pad_right;
            x = pad_left + bw;
         } else {
            size.fWidth = csize.fWidth;
         }

         if (hints & kLHintsExpandY) {
            if (size_expand >= exp_max)
               size.fHeight = size_expand - pad_top - pad_bottom;
            else
               size.fHeight = csize.fHeight + esize_expand;

            tmp_expand += rem_expand;
            if (tmp_expand >= nb_expand) {
               size.fHeight++;
               tmp_expand -= nb_expand;
            }
         } else {
            size.fHeight = csize.fHeight;
            if (hints & kLHintsCenterY) {
               if (size_expand >= exp_max) {
                  extra_space = (size_expand - pad_top - pad_bottom - size.fHeight) >> 1;
               } else {
                  extra_space = esize_expand >> 1;
               }
               y += extra_space;
               top += extra_space;
            }
         }

         if (hints & kLHintsBottom) {
            y = bottom - size.fHeight - pad_bottom;
            bottom -= size.fHeight + pad_top + pad_bottom;
         } else { // kLHintsTop by default
            y = top + pad_top;
            top += size.fHeight + pad_top + pad_bottom;
         }

         if (hints & kLHintsCenterY)
            top += extra_space;

         if (size.fWidth > 32768)
            size.fWidth = 1;
         if (size.fHeight > 32768)
            size.fHeight = 1;
         ptr->fFrame->MoveResize(x, y, size.fWidth, size.fHeight);

         fModified = fModified || (ptr->fFrame->GetX() != x) || 
                    (ptr->fFrame->GetY() != y) ||
                    (ptr->fFrame->GetWidth() != size.fWidth) ||
                    (ptr->fFrame->GetHeight() != size.fHeight);
      }
   }
}

//______________________________________________________________________________
TGDimension TGVerticalLayout::GetDefaultSize() const
{
   // Return default dimension of the vertical layout.

   TGFrameElement *ptr;
   TGDimension     size(0,0), msize = fMain->GetSize(), csize;
   UInt_t options = fMain->GetOptions();

   if ((options & kFixedWidth) && (options & kFixedHeight))
      return msize;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         csize = ptr->fFrame->GetDefaultSize();
         size.fWidth = TMath::Max(size.fWidth, csize.fWidth + ptr->fLayout->GetPadLeft() +
                                  ptr->fLayout->GetPadRight());
         size.fHeight += csize.fHeight + ptr->fLayout->GetPadTop() +
                         ptr->fLayout->GetPadBottom();
      }
   }

   size.fWidth  += fMain->GetBorderWidth() << 1;
   size.fHeight += fMain->GetBorderWidth() << 1;

   if (options & kFixedWidth)  size.fWidth  = msize.fWidth;
   if (options & kFixedHeight) size.fHeight = msize.fHeight;

   return size;
}

//______________________________________________________________________________
void TGHorizontalLayout::Layout()
{
   // Make a horizontal layout of all frames in the list.

   TGFrameElement *ptr;
   TGLayoutHints  *layout;
   Int_t    nb_expand = 0;
   Int_t    left, right;
   ULong_t  hints;
   UInt_t   extra_space = 0;
   Int_t    exp = 0;
   Int_t    exp_max = 0;
   Int_t    remain;
   Int_t    x = 0, y = 0;
   Int_t    bw = fMain->GetBorderWidth();
   TGDimension size, csize;
   TGDimension msize = fMain->GetSize();
   UInt_t pad_left, pad_top, pad_right, pad_bottom;
   Int_t size_expand=0, esize_expand=0, rem_expand=0, tmp_expand = 0;

   if (!fList) return;

   fModified = kFALSE;
   right  = msize.fWidth - (left = bw);
   remain = msize.fWidth - (bw << 1);

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         layout  = ptr->fLayout;
         size    = ptr->fFrame->GetDefaultSize();
         size.fWidth += layout->GetPadLeft() + layout->GetPadRight();
         hints = layout->GetLayoutHints();
         if ((hints & kLHintsExpandX) || (hints & kLHintsCenterX)) {
            nb_expand++;
            exp += size.fWidth;
            if (hints & kLHintsExpandX) exp_max = 0;
            else exp_max = TMath::Max(exp_max, (Int_t)size.fWidth);
         } else {
            remain -= size.fWidth;
            if (remain < 0)
               remain = 0;
         }
      }
   }
   if (nb_expand) {
      size_expand = remain/nb_expand;

      if (size_expand < exp_max) {
         esize_expand = (remain - exp)/nb_expand;
      }
      rem_expand = remain % nb_expand;
   }

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         hints = (layout = ptr->fLayout)->GetLayoutHints();
         csize      = ptr->fFrame->GetDefaultSize();
         pad_left   = layout->GetPadLeft();
         pad_top    = layout->GetPadTop();
         pad_right  = layout->GetPadRight();
         pad_bottom = layout->GetPadBottom();

         if (hints & kLHintsBottom) {
            y = msize.fHeight - bw - csize.fHeight - pad_bottom;
         } else if (hints & kLHintsCenterY) {
            y = (msize.fHeight - (bw << 1) - csize.fHeight) >> 1;
         } else { // kLHintsTop by default
            y = pad_top + bw;
         }

         if (hints & kLHintsExpandY) {
            size.fHeight = msize.fHeight - (bw << 1) - pad_top - pad_bottom;
            y = pad_top + bw;
         } else {
            size.fHeight = csize.fHeight;
         }

         if (hints & kLHintsExpandX) {
            if (size_expand >= exp_max)
               size.fWidth = size_expand - pad_left - pad_right;
            else
               size.fWidth = csize.fWidth +  esize_expand;

            tmp_expand += rem_expand;

            if (tmp_expand >= nb_expand) {
               size.fWidth++;
               tmp_expand -= nb_expand;
            }
         } else {
            size.fWidth = csize.fWidth;
            if (hints & kLHintsCenterX) {
               if (size_expand >= exp_max) {
                  extra_space = (size_expand - pad_left - pad_right - size.fWidth)>> 1;
               } else {
                  extra_space = esize_expand >> 1;
               }
               x += extra_space;
               left += extra_space;
            }
         }

         if (hints & kLHintsRight) {
            x = right - size.fWidth - pad_right;
            right -= size.fWidth + pad_left + pad_right;
         } else { // defaults to kLHintsLeft
            x = left + pad_left;
            left += size.fWidth + pad_left + pad_right;
         }

         if (hints & kLHintsCenterX)
            left += extra_space;

         ptr->fFrame->MoveResize(x, y, size.fWidth, size.fHeight);

         fModified = fModified || (ptr->fFrame->GetX() != x) || 
                    (ptr->fFrame->GetY() != y) ||
                    (ptr->fFrame->GetWidth() != size.fWidth) ||
                    (ptr->fFrame->GetHeight() != size.fHeight);
      }
   }
}

//______________________________________________________________________________
TGDimension TGHorizontalLayout::GetDefaultSize() const
{
   // Return default dimension of the horizontal layout.

   TGFrameElement *ptr;
   TGDimension     size(0,0), msize = fMain->GetSize(), csize;
   UInt_t options = fMain->GetOptions();

   if ((options & kFixedWidth) && (options & kFixedHeight))
      return msize;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         csize = ptr->fFrame->GetDefaultSize();
         size.fWidth += csize.fWidth + ptr->fLayout->GetPadLeft() +
                        ptr->fLayout->GetPadRight();

         size.fHeight = TMath::Max(size.fHeight, csize.fHeight + ptr->fLayout->GetPadTop() +
                                   ptr->fLayout->GetPadBottom());
      }
   }
   size.fWidth  += fMain->GetBorderWidth() << 1;
   size.fHeight += fMain->GetBorderWidth() << 1;

   if (options & kFixedWidth)  size.fWidth = msize.fWidth;
   if (options & kFixedHeight) size.fHeight = msize.fHeight;

   return size;
}

//______________________________________________________________________________
void TGRowLayout::Layout()
{
   // Make a row layout of all frames in the list.

   TGFrameElement *ptr;
   TGDimension     size;
   Int_t  bw = fMain->GetBorderWidth();
   Int_t  x = bw, y = bw;
   fModified = kFALSE;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         size = ptr->fFrame->GetDefaultSize();
         ptr->fFrame->Move(x, y);

         fModified = fModified || (ptr->fFrame->GetX() != x) || 
                    (ptr->fFrame->GetY() != y);

         ptr->fFrame->Layout();
         x += size.fWidth + fSep;
      }
   }
}

//______________________________________________________________________________
TGDimension TGRowLayout::GetDefaultSize() const
{
  // Return default dimension of the row layout.

   TGFrameElement *ptr;
   TGDimension size(0,0), dsize, msize = fMain->GetSize();
   UInt_t options = fMain->GetOptions();

   if ((options & kFixedHeight) && (options & kFixedWidth))
      return msize;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         dsize   = ptr->fFrame->GetDefaultSize();
         size.fHeight  = TMath::Max(size.fHeight, dsize.fHeight);
         size.fWidth  += dsize.fWidth + fSep;
      }
   }

   size.fHeight += fMain->GetBorderWidth() << 1;
   size.fWidth  += fMain->GetBorderWidth() << 1;
   size.fWidth  -= fSep;

   if (options & kFixedHeight) size.fHeight = msize.fHeight;
   if (options & kFixedWidth)  size.fWidth  = msize.fWidth;

   return size;
}

//______________________________________________________________________________
void TGColumnLayout::Layout()
{
   // Make a column layout of all frames in the list.

   TGFrameElement *ptr;
   TGDimension     size;
   Int_t  bw = fMain->GetBorderWidth();
   Int_t  x = bw, y = bw;
   fModified = kFALSE;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         size = ptr->fFrame->GetDefaultSize();
         ptr->fFrame->Move(x, y);
         fModified = fModified || (ptr->fFrame->GetX() != x) || 
                    (ptr->fFrame->GetY() != y);
         ptr->fFrame->Layout();
         y += size.fHeight + fSep;
      }
   }
}

//______________________________________________________________________________
TGDimension TGColumnLayout::GetDefaultSize() const
{
  // Return default dimension of the column layout.

   TGFrameElement *ptr;
   TGDimension     size(0,0), dsize, msize = fMain->GetSize();
   UInt_t options = fMain->GetOptions();

   if (options & kFixedHeight && options & kFixedWidth)
      return msize;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         dsize   = ptr->fFrame->GetDefaultSize();
         size.fHeight += dsize.fHeight + fSep;
         size.fWidth   = TMath::Max(size.fWidth, dsize.fWidth);
      }
   }

   size.fHeight += fMain->GetBorderWidth() << 1;
   size.fHeight -= fSep;
   size.fWidth  += fMain->GetBorderWidth() << 1;

   if (options & kFixedHeight) size.fHeight = msize.fHeight;
   if (options & kFixedWidth)  size.fWidth  = msize.fWidth;

   return size;
}

//______________________________________________________________________________
TGMatrixLayout::TGMatrixLayout(TGCompositeFrame *main, UInt_t r, UInt_t c,
                               Int_t s, Int_t h)
{
   // TGMatrixLayout constructor.

   fMain    = main;
   fList    = fMain->GetList();
   fSep     = s;
   fHints   = h;
   fRows    = r;
   fColumns = c;
}

//______________________________________________________________________________
void TGMatrixLayout::Layout()
{
   // Make a matrix layout of all frames in the list.

   TGFrameElement *ptr;
   TGDimension csize, maxsize(0,0);
   Int_t bw = fMain->GetBorderWidth();
   Int_t x = fSep, y = fSep + bw;
   UInt_t rowcount = fRows, colcount = fColumns;
   fModified = kFALSE;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      csize = ptr->fFrame->GetDefaultSize();
      maxsize.fWidth  = TMath::Max(maxsize.fWidth, csize.fWidth);
      maxsize.fHeight = TMath::Max(maxsize.fHeight, csize.fHeight);
   }

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      ptr->fFrame->Move(x, y);
      fModified = fModified || (ptr->fFrame->GetX() != x) || 
                   (ptr->fFrame->GetY() != y);

      ptr->fFrame->Layout();

      if (fColumns == 0) {
         y += maxsize.fHeight + fSep;
         rowcount--;
         if (rowcount <= 0) {
            rowcount = fRows;
            y = fSep + bw; x += maxsize.fWidth + fSep;
         }
      } else if (fRows == 0) {
         x += maxsize.fWidth + fSep;
         colcount--;
         if (colcount <= 0) {
            colcount = fColumns;
            x = fSep; y += maxsize.fHeight + fSep;
         }
      } else {
         x += maxsize.fWidth + fSep;
         colcount--;
         if (colcount <= 0) {
            rowcount--;
            if (rowcount <= 0) return;
            else {
               colcount = fColumns;
               x = fSep; y += maxsize.fHeight + fSep;
            }
         }
      }
   }
}

//______________________________________________________________________________
TGDimension TGMatrixLayout::GetDefaultSize() const
{
   // Return default dimension of the matrix layout.

   TGFrameElement *ptr;
   TGDimension     size, csize, maxsize(0,0);
   Int_t           count = 0;
   Int_t           bw = fMain->GetBorderWidth();

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      count++;
      csize = ptr->fFrame->GetDefaultSize();
      maxsize.fWidth  = TMath::Max(maxsize.fWidth, csize.fWidth);
      maxsize.fHeight = TMath::Max(maxsize.fHeight, csize.fHeight);
   }

   if (fRows == 0) {
      Int_t rows = (count % fColumns) ? (count / fColumns + 1) : (count / fColumns);
      size.fWidth  = fColumns * (maxsize.fWidth + fSep) + fSep;
      size.fHeight = rows * (maxsize.fHeight + fSep) + fSep + bw;
   } else if (fColumns == 0) {
      Int_t cols = (count % fRows) ? (count / fRows + 1) : (count / fRows);
      size.fWidth  = cols * (maxsize.fWidth + fSep) + fSep;
      size.fHeight = fRows * (maxsize.fHeight + fSep) + fSep + bw;
   } else {
      size.fWidth  = fColumns * (maxsize.fWidth + fSep) + fSep;
      size.fHeight = fRows * (maxsize.fHeight + fSep) + fSep + bw;
   }
   return size;
}

//______________________________________________________________________________
TGTileLayout::TGTileLayout(TGCompositeFrame *main, Int_t sep)
{
   // Create a tile layout manager.

   fMain = main;
   fSep  = sep;
   fList = fMain->GetList();
   fModified = kTRUE; 
}

//______________________________________________________________________________
void TGTileLayout::Layout()
{
   // Make a tile layout of all frames in the list.

   TGFrameElement *ptr;
   Int_t   x, y, xw, yw;
   UInt_t  max_width;
   ULong_t hints;
   TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
   fModified = kFALSE;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      csize = ptr->fFrame->GetDefaultSize();
      max_osize.fWidth  = TMath::Max(max_osize.fWidth, csize.fWidth);
      max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
   }

   max_width = TMath::Max(msize.fWidth, max_osize.fWidth + (fSep << 1));
   x = fSep; y = fSep << 1;

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      hints = ptr->fLayout->GetLayoutHints();
      csize = ptr->fFrame->GetDefaultSize();

      if (hints & kLHintsCenterX)
         xw = x + (Int_t)((max_osize.fWidth - csize.fWidth) >> 1);
      else if (hints & kLHintsRight)
         xw = x + (Int_t)max_osize.fWidth - (Int_t)csize.fWidth;
      else // defaults to kLHintsLeft
         xw = x;

      if (hints & kLHintsCenterY)
         yw = y + (Int_t)((max_osize.fHeight - csize.fHeight) >> 1);
      else if (hints & kLHintsBottom)
         yw = y + (Int_t)max_osize.fHeight - (Int_t)csize.fHeight;
      else // defaults to kLHintsTop
         yw = y;

      fModified = fModified || (ptr->fFrame->GetX() != xw) || 
                 (ptr->fFrame->GetY() != yw);
      ptr->fFrame->Move(xw, yw);
      if (hints & kLHintsExpandX)
         ptr->fFrame->Resize(max_osize.fWidth, ptr->fFrame->GetDefaultHeight());
      x += (Int_t)max_osize.fWidth + fSep;

      if (x + max_osize.fWidth > max_width) {
         x = fSep;
         y += (Int_t)max_osize.fHeight + fSep + (fSep >> 1);
      }
   }
}

//______________________________________________________________________________
TGDimension TGTileLayout::GetDefaultSize() const
{
   // Return default dimension of the tile layout.

   TGFrameElement *ptr;
   Int_t x, y;
   TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      max_size = ptr->fFrame->GetDefaultSize();
      max_osize.fWidth  = TMath::Max(max_osize.fWidth, max_size.fWidth);
      max_osize.fHeight = TMath::Max(max_osize.fHeight, max_size.fHeight);
   }

   max_size.fWidth = TMath::Max(msize.fWidth, max_osize.fWidth + (fSep << 1));

   x = fSep; y = fSep << 1;

   next.Reset();
   // coverity[returned_pointer]
   while ((ptr = (TGFrameElement *) next())) {
      x += max_osize.fWidth + fSep;
      if (x + max_osize.fWidth > max_size.fWidth) {
         x = fSep;
         y += (Int_t)max_osize.fHeight + fSep + (fSep >> 1);  // 3/2
      }
   }
   if (x != fSep) y += max_osize.fHeight + fSep;
   max_size.fHeight = TMath::Max(y, (Int_t)msize.fHeight);

   return max_size;
}

//______________________________________________________________________________
void TGListLayout::Layout()
{
   // Make a tile layout of all frames in the list.

   TGFrameElement *ptr;
   Int_t   x, y, xw, yw;
   UInt_t  max_height;
   ULong_t hints;
   TGDimension csize, max_osize(0,0), msize = fMain->GetSize();
   fModified = kFALSE;

   TIter next(fList);
   // coverity[returned_pointer]
   while ((ptr = (TGFrameElement *) next())) {
      csize = ptr->fFrame->GetDefaultSize();
      max_osize.fWidth  = TMath::Max(max_osize.fWidth, csize.fWidth);
      max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
   }

   max_height = TMath::Max(msize.fHeight, max_osize.fHeight + (fSep << 1));

   x = fSep; y = fSep << 1;

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {

      hints = ptr->fLayout->GetLayoutHints();
      csize = ptr->fFrame->GetDefaultSize();

      if (hints & kLHintsCenterX)
         xw = x + (Int_t)((max_osize.fWidth - csize.fWidth) >> 1);
      else if (hints & kLHintsRight)
         xw = x + (Int_t)max_osize.fWidth - (Int_t)csize.fWidth;
      else // defaults to kLHintsLeft
         xw = x;

      if (hints & kLHintsCenterY)
         yw = y + (Int_t)((max_osize.fHeight - csize.fHeight) >> 1);
      else if (hints & kLHintsBottom)
         yw = y + (Int_t)max_osize.fHeight - (Int_t)csize.fHeight;
      else // defaults to kLHintsTop
         yw = y;

      fModified = fModified || (ptr->fFrame->GetX() != xw) || 
                 (ptr->fFrame->GetY() != yw);
      ptr->fFrame->Move(xw, yw);
      if (hints & kLHintsExpandX)
         ptr->fFrame->Resize(max_osize.fWidth, ptr->fFrame->GetDefaultHeight());
      y += (Int_t)max_osize.fHeight + fSep + (fSep >> 1);

      if (y + max_osize.fHeight > max_height) {
         y = fSep << 1;
         x += (Int_t)max_osize.fWidth + fSep;
      }
   }
}

//______________________________________________________________________________
TGDimension TGListLayout::GetDefaultSize() const
{
   // Return default dimension of the list layout.

   TGFrameElement *ptr;
   Int_t x, y;
   TGDimension max_size, max_osize(0,0), msize = fMain->GetSize();

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      max_size = ptr->fFrame->GetDefaultSize();
      max_osize.fWidth  = TMath::Max(max_osize.fWidth, max_size.fWidth);
      max_osize.fHeight = TMath::Max(max_osize.fHeight, max_size.fHeight);
   }

   max_size.fHeight = TMath::Max(msize.fHeight, max_osize.fHeight + (fSep << 1));

   x = fSep; y = fSep << 1;

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      y += (Int_t)max_osize.fHeight + fSep + (fSep >> 1);
      if (y + max_osize.fHeight > max_size.fHeight) {
         y = fSep << 1;
         x += (Int_t)max_osize.fWidth + fSep;
      }
   }
   if (y != (fSep << 1)) x += (Int_t)max_osize.fWidth + fSep;
   max_size.fWidth = TMath::Max(x, (Int_t)msize.fWidth);

   return max_size;
}

//______________________________________________________________________________
void TGListDetailsLayout::Layout()
{
   // Make a list details layout of all frames in the list.

   TGFrameElement *ptr;
   TGDimension     csize, msize = fMain->GetSize();
   Int_t max_oh = 0, x = fSep, y = fSep << 1;
   fModified = kFALSE;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      csize = ptr->fFrame->GetDefaultSize();
      max_oh = TMath::Max(max_oh, (Int_t)csize.fHeight);
   }

   next.Reset();

   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         csize = ptr->fFrame->GetDefaultSize();

         fModified = fModified || (ptr->fFrame->GetX() != x) || 
                     (ptr->fFrame->GetY() != y);

         ptr->fFrame->MoveResize(x, y, msize.fWidth, csize.fHeight);
         ptr->fFrame->Layout();
         y += max_oh + fSep + (fSep >> 1);
      }
   }
}

//______________________________________________________________________________
TGDimension TGListDetailsLayout::GetDefaultSize() const
{
   // Return default dimension of the list details layout.

   TGFrameElement *ptr;
   TGDimension csize, max_osize(0,0);
   Int_t y = fSep << 1;

   TIter next(fList);
   while ((ptr = (TGFrameElement *) next())) {
      csize = ptr->fFrame->GetDefaultSize();
      max_osize.fWidth  = TMath::Max(max_osize.fWidth, csize.fWidth);
      max_osize.fHeight = TMath::Max(max_osize.fHeight, csize.fHeight);
   }

   next.Reset();
   while ((ptr = (TGFrameElement *) next())) {
      if (ptr->fState & kIsVisible) {
         y += max_osize.fHeight + fSep + (fSep >> 1);
      }
   }

   return TGDimension( fWidth ? fWidth : max_osize.fWidth, y);
}

// ________________________________________________________________________
void TGLayoutHints::SavePrimitive(ostream &out, Option_t * option/*= ""*/)
{

   // Save layout hints as a C++ statement(s) on output stream out

   TString hints;
   UInt_t pad = GetPadLeft()+GetPadRight()+GetPadTop()+GetPadBottom();

   if (!GetLayoutHints()) return;
   
   if ((option == 0) || strcmp(option, "nocoma"))
      out << ", ";

   if ((fLayoutHints == kLHintsNormal) && (pad == 0)) {
      out << "new TGLayoutHints(kLHintsNormal)";
      return;
   }
   if (fLayoutHints & kLHintsLeft) {
      if (hints.Length() == 0) hints  = "kLHintsLeft";
      else                     hints += " | kLHintsLeft";
   }
   if (fLayoutHints & kLHintsCenterX) {
      if  (hints.Length() == 0) hints  = "kLHintsCenterX";
      else                      hints += " | kLHintsCenterX";
   }
   if (fLayoutHints & kLHintsRight) {
      if (hints.Length() == 0) hints  = "kLHintsRight";
      else                     hints += " | kLHintsRight";
   }
   if (fLayoutHints & kLHintsTop) {
      if (hints.Length() == 0) hints  = "kLHintsTop";
      else                     hints += " | kLHintsTop";
   }
   if (fLayoutHints & kLHintsCenterY) {
      if (hints.Length() == 0) hints  = "kLHintsCenterY";
      else                     hints += " | kLHintsCenterY";
   }
   if (fLayoutHints & kLHintsBottom) {
      if (hints.Length() == 0) hints  = "kLHintsBottom";
      else                     hints += " | kLHintsBottom";
   }
   if (fLayoutHints & kLHintsExpandX) {
      if (hints.Length() == 0) hints  = "kLHintsExpandX";
      else                     hints += " | kLHintsExpandX";
   }
   if (fLayoutHints & kLHintsExpandY) {
      if (hints.Length() == 0) hints  = "kLHintsExpandY";
      else                     hints += " | kLHintsExpandY";
   }

   out << "new TGLayoutHints(" << hints;

   if (pad) {
      out << "," << GetPadLeft() << "," << GetPadRight()
          << "," << GetPadTop()  << "," << GetPadBottom();
   }
   out<< ")";
}

// __________________________________________________________________________
void TGVerticalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save vertical layout manager as a C++ statement(s) on output stream

   out << "new TGVerticalLayout(" << fMain->GetName() << ")";

}

// __________________________________________________________________________
void TGHorizontalLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save horizontal layout manager as a C++ statement(s) on output stream

   out << "new TGHorizontalLayout(" << fMain->GetName() << ")";
}

// __________________________________________________________________________
void TGRowLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save row layout manager as a C++ statement(s) on output stream

   out << "new TGRowLayout(" << fMain->GetName() << ","
                             << fSep << ")";
}

// __________________________________________________________________________
void TGColumnLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save column layout manager as a C++ statement(s) on output stream

   out << "new TGColumnLayout(" << fMain->GetName() << ","
                                << fSep << ")";

}

// __________________________________________________________________________
void TGMatrixLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save matrix layout manager as a C++ statement(s) on output stream

   out << "new TGMatrixLayout(" << fMain->GetName() << ","
                                << fRows << ","
                                << fColumns << ","
                                << fSep << ","
                                << fHints <<")";

}

// __________________________________________________________________________
void TGTileLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save tile layout manager as a C++ statement(s) on output stream

   out << "new TGTileLayout(" << fMain->GetName() << ","
                              << fSep << ")";

}

// __________________________________________________________________________
void TGListLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save list layout manager as a C++ statement(s) on output stream

   out << "new TGListLayout(" << fMain->GetName() << ","
                              << fSep << ")";

}

// __________________________________________________________________________
void TGListDetailsLayout::SavePrimitive(ostream &out, Option_t * /*= ""*/)
{

   // Save list details layout manager as a C++ statement(s) on out stream

   out << "new TGListDetailsLayout(" << fMain->GetName() << ","
                                     << fSep << "," << fWidth << ")";

}
 TGLayout.cxx:1
 TGLayout.cxx:2
 TGLayout.cxx:3
 TGLayout.cxx:4
 TGLayout.cxx:5
 TGLayout.cxx:6
 TGLayout.cxx:7
 TGLayout.cxx:8
 TGLayout.cxx:9
 TGLayout.cxx:10
 TGLayout.cxx:11
 TGLayout.cxx:12
 TGLayout.cxx:13
 TGLayout.cxx:14
 TGLayout.cxx:15
 TGLayout.cxx:16
 TGLayout.cxx:17
 TGLayout.cxx:18
 TGLayout.cxx:19
 TGLayout.cxx:20
 TGLayout.cxx:21
 TGLayout.cxx:22
 TGLayout.cxx:23
 TGLayout.cxx:24
 TGLayout.cxx:25
 TGLayout.cxx:26
 TGLayout.cxx:27
 TGLayout.cxx:28
 TGLayout.cxx:29
 TGLayout.cxx:30
 TGLayout.cxx:31
 TGLayout.cxx:32
 TGLayout.cxx:33
 TGLayout.cxx:34
 TGLayout.cxx:35
 TGLayout.cxx:36
 TGLayout.cxx:37
 TGLayout.cxx:38
 TGLayout.cxx:39
 TGLayout.cxx:40
 TGLayout.cxx:41
 TGLayout.cxx:42
 TGLayout.cxx:43
 TGLayout.cxx:44
 TGLayout.cxx:45
 TGLayout.cxx:46
 TGLayout.cxx:47
 TGLayout.cxx:48
 TGLayout.cxx:49
 TGLayout.cxx:50
 TGLayout.cxx:51
 TGLayout.cxx:52
 TGLayout.cxx:53
 TGLayout.cxx:54
 TGLayout.cxx:55
 TGLayout.cxx:56
 TGLayout.cxx:57
 TGLayout.cxx:58
 TGLayout.cxx:59
 TGLayout.cxx:60
 TGLayout.cxx:61
 TGLayout.cxx:62
 TGLayout.cxx:63
 TGLayout.cxx:64
 TGLayout.cxx:65
 TGLayout.cxx:66
 TGLayout.cxx:67
 TGLayout.cxx:68
 TGLayout.cxx:69
 TGLayout.cxx:70
 TGLayout.cxx:71
 TGLayout.cxx:72
 TGLayout.cxx:73
 TGLayout.cxx:74
 TGLayout.cxx:75
 TGLayout.cxx:76
 TGLayout.cxx:77
 TGLayout.cxx:78
 TGLayout.cxx:79
 TGLayout.cxx:80
 TGLayout.cxx:81
 TGLayout.cxx:82
 TGLayout.cxx:83
 TGLayout.cxx:84
 TGLayout.cxx:85
 TGLayout.cxx:86
 TGLayout.cxx:87
 TGLayout.cxx:88
 TGLayout.cxx:89
 TGLayout.cxx:90
 TGLayout.cxx:91
 TGLayout.cxx:92
 TGLayout.cxx:93
 TGLayout.cxx:94
 TGLayout.cxx:95
 TGLayout.cxx:96
 TGLayout.cxx:97
 TGLayout.cxx:98
 TGLayout.cxx:99
 TGLayout.cxx:100
 TGLayout.cxx:101
 TGLayout.cxx:102
 TGLayout.cxx:103
 TGLayout.cxx:104
 TGLayout.cxx:105
 TGLayout.cxx:106
 TGLayout.cxx:107
 TGLayout.cxx:108
 TGLayout.cxx:109
 TGLayout.cxx:110
 TGLayout.cxx:111
 TGLayout.cxx:112
 TGLayout.cxx:113
 TGLayout.cxx:114
 TGLayout.cxx:115
 TGLayout.cxx:116
 TGLayout.cxx:117
 TGLayout.cxx:118
 TGLayout.cxx:119
 TGLayout.cxx:120
 TGLayout.cxx:121
 TGLayout.cxx:122
 TGLayout.cxx:123
 TGLayout.cxx:124
 TGLayout.cxx:125
 TGLayout.cxx:126
 TGLayout.cxx:127
 TGLayout.cxx:128
 TGLayout.cxx:129
 TGLayout.cxx:130
 TGLayout.cxx:131
 TGLayout.cxx:132
 TGLayout.cxx:133
 TGLayout.cxx:134
 TGLayout.cxx:135
 TGLayout.cxx:136
 TGLayout.cxx:137
 TGLayout.cxx:138
 TGLayout.cxx:139
 TGLayout.cxx:140
 TGLayout.cxx:141
 TGLayout.cxx:142
 TGLayout.cxx:143
 TGLayout.cxx:144
 TGLayout.cxx:145
 TGLayout.cxx:146
 TGLayout.cxx:147
 TGLayout.cxx:148
 TGLayout.cxx:149
 TGLayout.cxx:150
 TGLayout.cxx:151
 TGLayout.cxx:152
 TGLayout.cxx:153
 TGLayout.cxx:154
 TGLayout.cxx:155
 TGLayout.cxx:156
 TGLayout.cxx:157
 TGLayout.cxx:158
 TGLayout.cxx:159
 TGLayout.cxx:160
 TGLayout.cxx:161
 TGLayout.cxx:162
 TGLayout.cxx:163
 TGLayout.cxx:164
 TGLayout.cxx:165
 TGLayout.cxx:166
 TGLayout.cxx:167
 TGLayout.cxx:168
 TGLayout.cxx:169
 TGLayout.cxx:170
 TGLayout.cxx:171
 TGLayout.cxx:172
 TGLayout.cxx:173
 TGLayout.cxx:174
 TGLayout.cxx:175
 TGLayout.cxx:176
 TGLayout.cxx:177
 TGLayout.cxx:178
 TGLayout.cxx:179
 TGLayout.cxx:180
 TGLayout.cxx:181
 TGLayout.cxx:182
 TGLayout.cxx:183
 TGLayout.cxx:184
 TGLayout.cxx:185
 TGLayout.cxx:186
 TGLayout.cxx:187
 TGLayout.cxx:188
 TGLayout.cxx:189
 TGLayout.cxx:190
 TGLayout.cxx:191
 TGLayout.cxx:192
 TGLayout.cxx:193
 TGLayout.cxx:194
 TGLayout.cxx:195
 TGLayout.cxx:196
 TGLayout.cxx:197
 TGLayout.cxx:198
 TGLayout.cxx:199
 TGLayout.cxx:200
 TGLayout.cxx:201
 TGLayout.cxx:202
 TGLayout.cxx:203
 TGLayout.cxx:204
 TGLayout.cxx:205
 TGLayout.cxx:206
 TGLayout.cxx:207
 TGLayout.cxx:208
 TGLayout.cxx:209
 TGLayout.cxx:210
 TGLayout.cxx:211
 TGLayout.cxx:212
 TGLayout.cxx:213
 TGLayout.cxx:214
 TGLayout.cxx:215
 TGLayout.cxx:216
 TGLayout.cxx:217
 TGLayout.cxx:218
 TGLayout.cxx:219
 TGLayout.cxx:220
 TGLayout.cxx:221
 TGLayout.cxx:222
 TGLayout.cxx:223
 TGLayout.cxx:224
 TGLayout.cxx:225
 TGLayout.cxx:226
 TGLayout.cxx:227
 TGLayout.cxx:228
 TGLayout.cxx:229
 TGLayout.cxx:230
 TGLayout.cxx:231
 TGLayout.cxx:232
 TGLayout.cxx:233
 TGLayout.cxx:234
 TGLayout.cxx:235
 TGLayout.cxx:236
 TGLayout.cxx:237
 TGLayout.cxx:238
 TGLayout.cxx:239
 TGLayout.cxx:240
 TGLayout.cxx:241
 TGLayout.cxx:242
 TGLayout.cxx:243
 TGLayout.cxx:244
 TGLayout.cxx:245
 TGLayout.cxx:246
 TGLayout.cxx:247
 TGLayout.cxx:248
 TGLayout.cxx:249
 TGLayout.cxx:250
 TGLayout.cxx:251
 TGLayout.cxx:252
 TGLayout.cxx:253
 TGLayout.cxx:254
 TGLayout.cxx:255
 TGLayout.cxx:256
 TGLayout.cxx:257
 TGLayout.cxx:258
 TGLayout.cxx:259
 TGLayout.cxx:260
 TGLayout.cxx:261
 TGLayout.cxx:262
 TGLayout.cxx:263
 TGLayout.cxx:264
 TGLayout.cxx:265
 TGLayout.cxx:266
 TGLayout.cxx:267
 TGLayout.cxx:268
 TGLayout.cxx:269
 TGLayout.cxx:270
 TGLayout.cxx:271
 TGLayout.cxx:272
 TGLayout.cxx:273
 TGLayout.cxx:274
 TGLayout.cxx:275
 TGLayout.cxx:276
 TGLayout.cxx:277
 TGLayout.cxx:278
 TGLayout.cxx:279
 TGLayout.cxx:280
 TGLayout.cxx:281
 TGLayout.cxx:282
 TGLayout.cxx:283
 TGLayout.cxx:284
 TGLayout.cxx:285
 TGLayout.cxx:286
 TGLayout.cxx:287
 TGLayout.cxx:288
 TGLayout.cxx:289
 TGLayout.cxx:290
 TGLayout.cxx:291
 TGLayout.cxx:292
 TGLayout.cxx:293
 TGLayout.cxx:294
 TGLayout.cxx:295
 TGLayout.cxx:296
 TGLayout.cxx:297
 TGLayout.cxx:298
 TGLayout.cxx:299
 TGLayout.cxx:300
 TGLayout.cxx:301
 TGLayout.cxx:302
 TGLayout.cxx:303
 TGLayout.cxx:304
 TGLayout.cxx:305
 TGLayout.cxx:306
 TGLayout.cxx:307
 TGLayout.cxx:308
 TGLayout.cxx:309
 TGLayout.cxx:310
 TGLayout.cxx:311
 TGLayout.cxx:312
 TGLayout.cxx:313
 TGLayout.cxx:314
 TGLayout.cxx:315
 TGLayout.cxx:316
 TGLayout.cxx:317
 TGLayout.cxx:318
 TGLayout.cxx:319
 TGLayout.cxx:320
 TGLayout.cxx:321
 TGLayout.cxx:322
 TGLayout.cxx:323
 TGLayout.cxx:324
 TGLayout.cxx:325
 TGLayout.cxx:326
 TGLayout.cxx:327
 TGLayout.cxx:328
 TGLayout.cxx:329
 TGLayout.cxx:330
 TGLayout.cxx:331
 TGLayout.cxx:332
 TGLayout.cxx:333
 TGLayout.cxx:334
 TGLayout.cxx:335
 TGLayout.cxx:336
 TGLayout.cxx:337
 TGLayout.cxx:338
 TGLayout.cxx:339
 TGLayout.cxx:340
 TGLayout.cxx:341
 TGLayout.cxx:342
 TGLayout.cxx:343
 TGLayout.cxx:344
 TGLayout.cxx:345
 TGLayout.cxx:346
 TGLayout.cxx:347
 TGLayout.cxx:348
 TGLayout.cxx:349
 TGLayout.cxx:350
 TGLayout.cxx:351
 TGLayout.cxx:352
 TGLayout.cxx:353
 TGLayout.cxx:354
 TGLayout.cxx:355
 TGLayout.cxx:356
 TGLayout.cxx:357
 TGLayout.cxx:358
 TGLayout.cxx:359
 TGLayout.cxx:360
 TGLayout.cxx:361
 TGLayout.cxx:362
 TGLayout.cxx:363
 TGLayout.cxx:364
 TGLayout.cxx:365
 TGLayout.cxx:366
 TGLayout.cxx:367
 TGLayout.cxx:368
 TGLayout.cxx:369
 TGLayout.cxx:370
 TGLayout.cxx:371
 TGLayout.cxx:372
 TGLayout.cxx:373
 TGLayout.cxx:374
 TGLayout.cxx:375
 TGLayout.cxx:376
 TGLayout.cxx:377
 TGLayout.cxx:378
 TGLayout.cxx:379
 TGLayout.cxx:380
 TGLayout.cxx:381
 TGLayout.cxx:382
 TGLayout.cxx:383
 TGLayout.cxx:384
 TGLayout.cxx:385
 TGLayout.cxx:386
 TGLayout.cxx:387
 TGLayout.cxx:388
 TGLayout.cxx:389
 TGLayout.cxx:390
 TGLayout.cxx:391
 TGLayout.cxx:392
 TGLayout.cxx:393
 TGLayout.cxx:394
 TGLayout.cxx:395
 TGLayout.cxx:396
 TGLayout.cxx:397
 TGLayout.cxx:398
 TGLayout.cxx:399
 TGLayout.cxx:400
 TGLayout.cxx:401
 TGLayout.cxx:402
 TGLayout.cxx:403
 TGLayout.cxx:404
 TGLayout.cxx:405
 TGLayout.cxx:406
 TGLayout.cxx:407
 TGLayout.cxx:408
 TGLayout.cxx:409
 TGLayout.cxx:410
 TGLayout.cxx:411
 TGLayout.cxx:412
 TGLayout.cxx:413
 TGLayout.cxx:414
 TGLayout.cxx:415
 TGLayout.cxx:416
 TGLayout.cxx:417
 TGLayout.cxx:418
 TGLayout.cxx:419
 TGLayout.cxx:420
 TGLayout.cxx:421
 TGLayout.cxx:422
 TGLayout.cxx:423
 TGLayout.cxx:424
 TGLayout.cxx:425
 TGLayout.cxx:426
 TGLayout.cxx:427
 TGLayout.cxx:428
 TGLayout.cxx:429
 TGLayout.cxx:430
 TGLayout.cxx:431
 TGLayout.cxx:432
 TGLayout.cxx:433
 TGLayout.cxx:434
 TGLayout.cxx:435
 TGLayout.cxx:436
 TGLayout.cxx:437
 TGLayout.cxx:438
 TGLayout.cxx:439
 TGLayout.cxx:440
 TGLayout.cxx:441
 TGLayout.cxx:442
 TGLayout.cxx:443
 TGLayout.cxx:444
 TGLayout.cxx:445
 TGLayout.cxx:446
 TGLayout.cxx:447
 TGLayout.cxx:448
 TGLayout.cxx:449
 TGLayout.cxx:450
 TGLayout.cxx:451
 TGLayout.cxx:452
 TGLayout.cxx:453
 TGLayout.cxx:454
 TGLayout.cxx:455
 TGLayout.cxx:456
 TGLayout.cxx:457
 TGLayout.cxx:458
 TGLayout.cxx:459
 TGLayout.cxx:460
 TGLayout.cxx:461
 TGLayout.cxx:462
 TGLayout.cxx:463
 TGLayout.cxx:464
 TGLayout.cxx:465
 TGLayout.cxx:466
 TGLayout.cxx:467
 TGLayout.cxx:468
 TGLayout.cxx:469
 TGLayout.cxx:470
 TGLayout.cxx:471
 TGLayout.cxx:472
 TGLayout.cxx:473
 TGLayout.cxx:474
 TGLayout.cxx:475
 TGLayout.cxx:476
 TGLayout.cxx:477
 TGLayout.cxx:478
 TGLayout.cxx:479
 TGLayout.cxx:480
 TGLayout.cxx:481
 TGLayout.cxx:482
 TGLayout.cxx:483
 TGLayout.cxx:484
 TGLayout.cxx:485
 TGLayout.cxx:486
 TGLayout.cxx:487
 TGLayout.cxx:488
 TGLayout.cxx:489
 TGLayout.cxx:490
 TGLayout.cxx:491
 TGLayout.cxx:492
 TGLayout.cxx:493
 TGLayout.cxx:494
 TGLayout.cxx:495
 TGLayout.cxx:496
 TGLayout.cxx:497
 TGLayout.cxx:498
 TGLayout.cxx:499
 TGLayout.cxx:500
 TGLayout.cxx:501
 TGLayout.cxx:502
 TGLayout.cxx:503
 TGLayout.cxx:504
 TGLayout.cxx:505
 TGLayout.cxx:506
 TGLayout.cxx:507
 TGLayout.cxx:508
 TGLayout.cxx:509
 TGLayout.cxx:510
 TGLayout.cxx:511
 TGLayout.cxx:512
 TGLayout.cxx:513
 TGLayout.cxx:514
 TGLayout.cxx:515
 TGLayout.cxx:516
 TGLayout.cxx:517
 TGLayout.cxx:518
 TGLayout.cxx:519
 TGLayout.cxx:520
 TGLayout.cxx:521
 TGLayout.cxx:522
 TGLayout.cxx:523
 TGLayout.cxx:524
 TGLayout.cxx:525
 TGLayout.cxx:526
 TGLayout.cxx:527
 TGLayout.cxx:528
 TGLayout.cxx:529
 TGLayout.cxx:530
 TGLayout.cxx:531
 TGLayout.cxx:532
 TGLayout.cxx:533
 TGLayout.cxx:534
 TGLayout.cxx:535
 TGLayout.cxx:536
 TGLayout.cxx:537
 TGLayout.cxx:538
 TGLayout.cxx:539
 TGLayout.cxx:540
 TGLayout.cxx:541
 TGLayout.cxx:542
 TGLayout.cxx:543
 TGLayout.cxx:544
 TGLayout.cxx:545
 TGLayout.cxx:546
 TGLayout.cxx:547
 TGLayout.cxx:548
 TGLayout.cxx:549
 TGLayout.cxx:550
 TGLayout.cxx:551
 TGLayout.cxx:552
 TGLayout.cxx:553
 TGLayout.cxx:554
 TGLayout.cxx:555
 TGLayout.cxx:556
 TGLayout.cxx:557
 TGLayout.cxx:558
 TGLayout.cxx:559
 TGLayout.cxx:560
 TGLayout.cxx:561
 TGLayout.cxx:562
 TGLayout.cxx:563
 TGLayout.cxx:564
 TGLayout.cxx:565
 TGLayout.cxx:566
 TGLayout.cxx:567
 TGLayout.cxx:568
 TGLayout.cxx:569
 TGLayout.cxx:570
 TGLayout.cxx:571
 TGLayout.cxx:572
 TGLayout.cxx:573
 TGLayout.cxx:574
 TGLayout.cxx:575
 TGLayout.cxx:576
 TGLayout.cxx:577
 TGLayout.cxx:578
 TGLayout.cxx:579
 TGLayout.cxx:580
 TGLayout.cxx:581
 TGLayout.cxx:582
 TGLayout.cxx:583
 TGLayout.cxx:584
 TGLayout.cxx:585
 TGLayout.cxx:586
 TGLayout.cxx:587
 TGLayout.cxx:588
 TGLayout.cxx:589
 TGLayout.cxx:590
 TGLayout.cxx:591
 TGLayout.cxx:592
 TGLayout.cxx:593
 TGLayout.cxx:594
 TGLayout.cxx:595
 TGLayout.cxx:596
 TGLayout.cxx:597
 TGLayout.cxx:598
 TGLayout.cxx:599
 TGLayout.cxx:600
 TGLayout.cxx:601
 TGLayout.cxx:602
 TGLayout.cxx:603
 TGLayout.cxx:604
 TGLayout.cxx:605
 TGLayout.cxx:606
 TGLayout.cxx:607
 TGLayout.cxx:608
 TGLayout.cxx:609
 TGLayout.cxx:610
 TGLayout.cxx:611
 TGLayout.cxx:612
 TGLayout.cxx:613
 TGLayout.cxx:614
 TGLayout.cxx:615
 TGLayout.cxx:616
 TGLayout.cxx:617
 TGLayout.cxx:618
 TGLayout.cxx:619
 TGLayout.cxx:620
 TGLayout.cxx:621
 TGLayout.cxx:622
 TGLayout.cxx:623
 TGLayout.cxx:624
 TGLayout.cxx:625
 TGLayout.cxx:626
 TGLayout.cxx:627
 TGLayout.cxx:628
 TGLayout.cxx:629
 TGLayout.cxx:630
 TGLayout.cxx:631
 TGLayout.cxx:632
 TGLayout.cxx:633
 TGLayout.cxx:634
 TGLayout.cxx:635
 TGLayout.cxx:636
 TGLayout.cxx:637
 TGLayout.cxx:638
 TGLayout.cxx:639
 TGLayout.cxx:640
 TGLayout.cxx:641
 TGLayout.cxx:642
 TGLayout.cxx:643
 TGLayout.cxx:644
 TGLayout.cxx:645
 TGLayout.cxx:646
 TGLayout.cxx:647
 TGLayout.cxx:648
 TGLayout.cxx:649
 TGLayout.cxx:650
 TGLayout.cxx:651
 TGLayout.cxx:652
 TGLayout.cxx:653
 TGLayout.cxx:654
 TGLayout.cxx:655
 TGLayout.cxx:656
 TGLayout.cxx:657
 TGLayout.cxx:658
 TGLayout.cxx:659
 TGLayout.cxx:660
 TGLayout.cxx:661
 TGLayout.cxx:662
 TGLayout.cxx:663
 TGLayout.cxx:664
 TGLayout.cxx:665
 TGLayout.cxx:666
 TGLayout.cxx:667
 TGLayout.cxx:668
 TGLayout.cxx:669
 TGLayout.cxx:670
 TGLayout.cxx:671
 TGLayout.cxx:672
 TGLayout.cxx:673
 TGLayout.cxx:674
 TGLayout.cxx:675
 TGLayout.cxx:676
 TGLayout.cxx:677
 TGLayout.cxx:678
 TGLayout.cxx:679
 TGLayout.cxx:680
 TGLayout.cxx:681
 TGLayout.cxx:682
 TGLayout.cxx:683
 TGLayout.cxx:684
 TGLayout.cxx:685
 TGLayout.cxx:686
 TGLayout.cxx:687
 TGLayout.cxx:688
 TGLayout.cxx:689
 TGLayout.cxx:690
 TGLayout.cxx:691
 TGLayout.cxx:692
 TGLayout.cxx:693
 TGLayout.cxx:694
 TGLayout.cxx:695
 TGLayout.cxx:696
 TGLayout.cxx:697
 TGLayout.cxx:698
 TGLayout.cxx:699
 TGLayout.cxx:700
 TGLayout.cxx:701
 TGLayout.cxx:702
 TGLayout.cxx:703
 TGLayout.cxx:704
 TGLayout.cxx:705
 TGLayout.cxx:706
 TGLayout.cxx:707
 TGLayout.cxx:708
 TGLayout.cxx:709
 TGLayout.cxx:710
 TGLayout.cxx:711
 TGLayout.cxx:712
 TGLayout.cxx:713
 TGLayout.cxx:714
 TGLayout.cxx:715
 TGLayout.cxx:716
 TGLayout.cxx:717
 TGLayout.cxx:718
 TGLayout.cxx:719
 TGLayout.cxx:720
 TGLayout.cxx:721
 TGLayout.cxx:722
 TGLayout.cxx:723
 TGLayout.cxx:724
 TGLayout.cxx:725
 TGLayout.cxx:726
 TGLayout.cxx:727
 TGLayout.cxx:728
 TGLayout.cxx:729
 TGLayout.cxx:730
 TGLayout.cxx:731
 TGLayout.cxx:732
 TGLayout.cxx:733
 TGLayout.cxx:734
 TGLayout.cxx:735
 TGLayout.cxx:736
 TGLayout.cxx:737
 TGLayout.cxx:738
 TGLayout.cxx:739
 TGLayout.cxx:740
 TGLayout.cxx:741
 TGLayout.cxx:742
 TGLayout.cxx:743
 TGLayout.cxx:744
 TGLayout.cxx:745
 TGLayout.cxx:746
 TGLayout.cxx:747
 TGLayout.cxx:748
 TGLayout.cxx:749
 TGLayout.cxx:750
 TGLayout.cxx:751
 TGLayout.cxx:752
 TGLayout.cxx:753
 TGLayout.cxx:754
 TGLayout.cxx:755
 TGLayout.cxx:756
 TGLayout.cxx:757
 TGLayout.cxx:758
 TGLayout.cxx:759
 TGLayout.cxx:760
 TGLayout.cxx:761
 TGLayout.cxx:762
 TGLayout.cxx:763
 TGLayout.cxx:764
 TGLayout.cxx:765
 TGLayout.cxx:766
 TGLayout.cxx:767
 TGLayout.cxx:768
 TGLayout.cxx:769
 TGLayout.cxx:770
 TGLayout.cxx:771
 TGLayout.cxx:772
 TGLayout.cxx:773
 TGLayout.cxx:774
 TGLayout.cxx:775
 TGLayout.cxx:776
 TGLayout.cxx:777
 TGLayout.cxx:778
 TGLayout.cxx:779
 TGLayout.cxx:780
 TGLayout.cxx:781
 TGLayout.cxx:782
 TGLayout.cxx:783
 TGLayout.cxx:784
 TGLayout.cxx:785
 TGLayout.cxx:786
 TGLayout.cxx:787
 TGLayout.cxx:788
 TGLayout.cxx:789
 TGLayout.cxx:790
 TGLayout.cxx:791
 TGLayout.cxx:792
 TGLayout.cxx:793
 TGLayout.cxx:794
 TGLayout.cxx:795
 TGLayout.cxx:796
 TGLayout.cxx:797
 TGLayout.cxx:798
 TGLayout.cxx:799
 TGLayout.cxx:800
 TGLayout.cxx:801
 TGLayout.cxx:802
 TGLayout.cxx:803
 TGLayout.cxx:804
 TGLayout.cxx:805
 TGLayout.cxx:806
 TGLayout.cxx:807
 TGLayout.cxx:808
 TGLayout.cxx:809
 TGLayout.cxx:810
 TGLayout.cxx:811
 TGLayout.cxx:812
 TGLayout.cxx:813
 TGLayout.cxx:814
 TGLayout.cxx:815
 TGLayout.cxx:816
 TGLayout.cxx:817
 TGLayout.cxx:818
 TGLayout.cxx:819
 TGLayout.cxx:820
 TGLayout.cxx:821
 TGLayout.cxx:822
 TGLayout.cxx:823
 TGLayout.cxx:824
 TGLayout.cxx:825
 TGLayout.cxx:826
 TGLayout.cxx:827
 TGLayout.cxx:828
 TGLayout.cxx:829
 TGLayout.cxx:830
 TGLayout.cxx:831
 TGLayout.cxx:832
 TGLayout.cxx:833
 TGLayout.cxx:834
 TGLayout.cxx:835
 TGLayout.cxx:836
 TGLayout.cxx:837
 TGLayout.cxx:838
 TGLayout.cxx:839
 TGLayout.cxx:840
 TGLayout.cxx:841
 TGLayout.cxx:842
 TGLayout.cxx:843
 TGLayout.cxx:844
 TGLayout.cxx:845
 TGLayout.cxx:846
 TGLayout.cxx:847
 TGLayout.cxx:848
 TGLayout.cxx:849
 TGLayout.cxx:850
 TGLayout.cxx:851
 TGLayout.cxx:852
 TGLayout.cxx:853
 TGLayout.cxx:854
 TGLayout.cxx:855
 TGLayout.cxx:856
 TGLayout.cxx:857
 TGLayout.cxx:858
 TGLayout.cxx:859
 TGLayout.cxx:860
 TGLayout.cxx:861
 TGLayout.cxx:862
 TGLayout.cxx:863
 TGLayout.cxx:864
 TGLayout.cxx:865
 TGLayout.cxx:866
 TGLayout.cxx:867
 TGLayout.cxx:868
 TGLayout.cxx:869
 TGLayout.cxx:870
 TGLayout.cxx:871
 TGLayout.cxx:872
 TGLayout.cxx:873
 TGLayout.cxx:874
 TGLayout.cxx:875
 TGLayout.cxx:876
 TGLayout.cxx:877
 TGLayout.cxx:878
 TGLayout.cxx:879
 TGLayout.cxx:880
 TGLayout.cxx:881
 TGLayout.cxx:882
 TGLayout.cxx:883
 TGLayout.cxx:884
 TGLayout.cxx:885
 TGLayout.cxx:886
 TGLayout.cxx:887
 TGLayout.cxx:888
 TGLayout.cxx:889
 TGLayout.cxx:890
 TGLayout.cxx:891
 TGLayout.cxx:892
 TGLayout.cxx:893
 TGLayout.cxx:894
 TGLayout.cxx:895
 TGLayout.cxx:896
 TGLayout.cxx:897
 TGLayout.cxx:898
 TGLayout.cxx:899
 TGLayout.cxx:900
 TGLayout.cxx:901
 TGLayout.cxx:902
 TGLayout.cxx:903
 TGLayout.cxx:904
 TGLayout.cxx:905
 TGLayout.cxx:906
 TGLayout.cxx:907
 TGLayout.cxx:908
 TGLayout.cxx:909
 TGLayout.cxx:910
 TGLayout.cxx:911
 TGLayout.cxx:912
 TGLayout.cxx:913
 TGLayout.cxx:914
 TGLayout.cxx:915
 TGLayout.cxx:916
 TGLayout.cxx:917
 TGLayout.cxx:918
 TGLayout.cxx:919
 TGLayout.cxx:920
 TGLayout.cxx:921
 TGLayout.cxx:922
 TGLayout.cxx:923
 TGLayout.cxx:924
 TGLayout.cxx:925
 TGLayout.cxx:926
 TGLayout.cxx:927
 TGLayout.cxx:928
 TGLayout.cxx:929
 TGLayout.cxx:930
 TGLayout.cxx:931
 TGLayout.cxx:932
 TGLayout.cxx:933
 TGLayout.cxx:934
 TGLayout.cxx:935
 TGLayout.cxx:936
 TGLayout.cxx:937
 TGLayout.cxx:938
 TGLayout.cxx:939
 TGLayout.cxx:940
 TGLayout.cxx:941
 TGLayout.cxx:942
 TGLayout.cxx:943
 TGLayout.cxx:944
 TGLayout.cxx:945
 TGLayout.cxx:946
 TGLayout.cxx:947
 TGLayout.cxx:948
 TGLayout.cxx:949
 TGLayout.cxx:950
 TGLayout.cxx:951
 TGLayout.cxx:952
 TGLayout.cxx:953
 TGLayout.cxx:954
 TGLayout.cxx:955
 TGLayout.cxx:956
 TGLayout.cxx:957
 TGLayout.cxx:958
 TGLayout.cxx:959
 TGLayout.cxx:960
 TGLayout.cxx:961
 TGLayout.cxx:962
 TGLayout.cxx:963
 TGLayout.cxx:964
 TGLayout.cxx:965
 TGLayout.cxx:966
 TGLayout.cxx:967
 TGLayout.cxx:968
 TGLayout.cxx:969
 TGLayout.cxx:970
 TGLayout.cxx:971
 TGLayout.cxx:972
 TGLayout.cxx:973
 TGLayout.cxx:974
 TGLayout.cxx:975
 TGLayout.cxx:976
 TGLayout.cxx:977
 TGLayout.cxx:978
 TGLayout.cxx:979
 TGLayout.cxx:980
 TGLayout.cxx:981
 TGLayout.cxx:982
 TGLayout.cxx:983
 TGLayout.cxx:984
 TGLayout.cxx:985
 TGLayout.cxx:986
 TGLayout.cxx:987
 TGLayout.cxx:988
 TGLayout.cxx:989
 TGLayout.cxx:990
 TGLayout.cxx:991
 TGLayout.cxx:992
 TGLayout.cxx:993
 TGLayout.cxx:994
 TGLayout.cxx:995
 TGLayout.cxx:996
 TGLayout.cxx:997
 TGLayout.cxx:998
 TGLayout.cxx:999
 TGLayout.cxx:1000
 TGLayout.cxx:1001
 TGLayout.cxx:1002
 TGLayout.cxx:1003
 TGLayout.cxx:1004
 TGLayout.cxx:1005
 TGLayout.cxx:1006
 TGLayout.cxx:1007
 TGLayout.cxx:1008
 TGLayout.cxx:1009
 TGLayout.cxx:1010
 TGLayout.cxx:1011
 TGLayout.cxx:1012
 TGLayout.cxx:1013
 TGLayout.cxx:1014
 TGLayout.cxx:1015
 TGLayout.cxx:1016
 TGLayout.cxx:1017
 TGLayout.cxx:1018
 TGLayout.cxx:1019
 TGLayout.cxx:1020
 TGLayout.cxx:1021
 TGLayout.cxx:1022
 TGLayout.cxx:1023
 TGLayout.cxx:1024
 TGLayout.cxx:1025
 TGLayout.cxx:1026
 TGLayout.cxx:1027
 TGLayout.cxx:1028
 TGLayout.cxx:1029
 TGLayout.cxx:1030
 TGLayout.cxx:1031
 TGLayout.cxx:1032
 TGLayout.cxx:1033
 TGLayout.cxx:1034
 TGLayout.cxx:1035
 TGLayout.cxx:1036
 TGLayout.cxx:1037
 TGLayout.cxx:1038
 TGLayout.cxx:1039
 TGLayout.cxx:1040
 TGLayout.cxx:1041
 TGLayout.cxx:1042
 TGLayout.cxx:1043
 TGLayout.cxx:1044
 TGLayout.cxx:1045
 TGLayout.cxx:1046
 TGLayout.cxx:1047
 TGLayout.cxx:1048
 TGLayout.cxx:1049
 TGLayout.cxx:1050
 TGLayout.cxx:1051
 TGLayout.cxx:1052
 TGLayout.cxx:1053
 TGLayout.cxx:1054
 TGLayout.cxx:1055
 TGLayout.cxx:1056
 TGLayout.cxx:1057
 TGLayout.cxx:1058
 TGLayout.cxx:1059
 TGLayout.cxx:1060
 TGLayout.cxx:1061
 TGLayout.cxx:1062
 TGLayout.cxx:1063
 TGLayout.cxx:1064
 TGLayout.cxx:1065
 TGLayout.cxx:1066
 TGLayout.cxx:1067
 TGLayout.cxx:1068
 TGLayout.cxx:1069
 TGLayout.cxx:1070
 TGLayout.cxx:1071
 TGLayout.cxx:1072
 TGLayout.cxx:1073
 TGLayout.cxx:1074
 TGLayout.cxx:1075
 TGLayout.cxx:1076
 TGLayout.cxx:1077
 TGLayout.cxx:1078
 TGLayout.cxx:1079
 TGLayout.cxx:1080
 TGLayout.cxx:1081
 TGLayout.cxx:1082
 TGLayout.cxx:1083
 TGLayout.cxx:1084
 TGLayout.cxx:1085
 TGLayout.cxx:1086
 TGLayout.cxx:1087
 TGLayout.cxx:1088
 TGLayout.cxx:1089
 TGLayout.cxx:1090
 TGLayout.cxx:1091
 TGLayout.cxx:1092
 TGLayout.cxx:1093
 TGLayout.cxx:1094
 TGLayout.cxx:1095
 TGLayout.cxx:1096
 TGLayout.cxx:1097
 TGLayout.cxx:1098
 TGLayout.cxx:1099
 TGLayout.cxx:1100
 TGLayout.cxx:1101
 TGLayout.cxx:1102
 TGLayout.cxx:1103
 TGLayout.cxx:1104
 TGLayout.cxx:1105
 TGLayout.cxx:1106
 TGLayout.cxx:1107
 TGLayout.cxx:1108
 TGLayout.cxx:1109
 TGLayout.cxx:1110
 TGLayout.cxx:1111
 TGLayout.cxx:1112
 TGLayout.cxx:1113
 TGLayout.cxx:1114
 TGLayout.cxx:1115
 TGLayout.cxx:1116
 TGLayout.cxx:1117
 TGLayout.cxx:1118
 TGLayout.cxx:1119
 TGLayout.cxx:1120
 TGLayout.cxx:1121
 TGLayout.cxx:1122
 TGLayout.cxx:1123
 TGLayout.cxx:1124
 TGLayout.cxx:1125
 TGLayout.cxx:1126
 TGLayout.cxx:1127
 TGLayout.cxx:1128
 TGLayout.cxx:1129
 TGLayout.cxx:1130
 TGLayout.cxx:1131
 TGLayout.cxx:1132
 TGLayout.cxx:1133
 TGLayout.cxx:1134
 TGLayout.cxx:1135
 TGLayout.cxx:1136
 TGLayout.cxx:1137
 TGLayout.cxx:1138
 TGLayout.cxx:1139
 TGLayout.cxx:1140
 TGLayout.cxx:1141
 TGLayout.cxx:1142
 TGLayout.cxx:1143
 TGLayout.cxx:1144
 TGLayout.cxx:1145